Icon

06_​Modified Variables Propagation in GET Request Loop

Modified Variables Propagation in GET Request Loop

This workflow demostrates the use of the option "Propagate modified loop variables" available in Loop End nodes.
The workflow repeats sending GET requests (where the maximum number of results is limited to 40) to get all the relevant book authors and titles for a provided search term untill the starting index of an item (a book) is larger than the total number of available items for this search term.

The workflow demonstrates the difference for external, injected, and internal variables when the propagation of modified variables option is on.

This workflow uses Google Books API to get the titles and the authors for the books corresponding to the provided search terms.
External variable -Updated in loop -Exported after loop execution
Injected variable -Reset at each iteration -Exported after loop execution with value of last iteration
Internal variable -Reset at each iteration -Discarded after loop execution
External variable startIndex was modified at each iteration, its modified value was propagated to the Loop Start at each iteration and exported from the loop body. Injected variable base_url was modified in the loop body but wasn't propagated each time to the Loop Start and was exported modified according to the last iteration Internal variable totalItems was created inside the loop body, wasn't propagated to the Loop Start and wasn't exported.
Send request to API
GET Request
JSON Path
Ungroup
Table Row to Variable
Iterate result pages(max 40 results per page)
Generic Loop Start
Create variable total items with total number of results available
Table Row to Variable
Create URL with startIndex parameter
String Manipulation (Variable)
Create base URL for Google Books API
Variable Creator
Provide a search term
Table Creator
Create variable startIndex=0
Variable Creator
increment startIndex adding number of results of this iteration
Math Formula (Variable)
Extract Table Dimension
Propagate modified loop variablesoption is enabled
Variable Condition Loop End

Nodes

Extensions

Links