Implement for loops in procedures #173

Closed
opened 2022-07-05 01:39:04 +02:00 by blacklight · 0 comments
Owner

Created by: BlackLight

It should be possible to loop over lists through a simple for loop in a synchronous procedure.

Example:

procedure.sync.process_results:
-
    action: http.get
    args:
        url: https://some-service/some/json/endpoint
        # Example response: { "results": [ {"id":1, "name":"foo"}, {"id":2,"name":"bar"} ]}
-
    for result in ${results}:
        -
            action: some.custom.action
            args:
                id: ${result['id']}
                name: ${result['name']}
*Created by: BlackLight* It should be possible to loop over lists through a simple `for` loop in a synchronous procedure. Example: ```yaml procedure.sync.process_results: - action: http.get args: url: https://some-service/some/json/endpoint # Example response: { "results": [ {"id":1, "name":"foo"}, {"id":2,"name":"bar"} ]} - for result in ${results}: - action: some.custom.action args: id: ${result['id']} name: ${result['name']} ```
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: platypush/platypush#173
No description provided.