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 wasmodified at each iteration, itsmodified value was propagated tothe Loop Start at each iteration andexported from the loop body.Injected variable base_url was modifiedin the loop body but wasn't propagatedeach time to the Loop Start and wasexported modified according to thelast iterationInternal variable totalItems was createdinside the loop body, wasn't propagated to the Loop Start and wasn't exported. Send requestto API Propagate modified loop variablesoption is enabledCreate variabletotal items with total numberof results availableProvide a search termCreate base URLfor Google Books APIincrement startIndexadding number of resultsof this iterationCreate variable startIndex=0Iterate result pages(max 40 results per page)Create URL withstartIndex parameterJSON Path GET Request Ungroup Variable ConditionLoop End Table Rowto Variable Table Creator Variable Creator Math Formula(Variable) Variable Creator Extract TableDimension Generic Loop Start Table Rowto Variable String Manipulation(Variable) 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 wasmodified at each iteration, itsmodified value was propagated tothe Loop Start at each iteration andexported from the loop body.Injected variable base_url was modifiedin the loop body but wasn't propagatedeach time to the Loop Start and wasexported modified according to thelast iterationInternal variable totalItems was createdinside the loop body, wasn't propagated to the Loop Start and wasn't exported. Send requestto API Propagate modified loop variablesoption is enabledCreate variabletotal items with total numberof results availableProvide a search termCreate base URLfor Google Books APIincrement startIndexadding number of resultsof this iterationCreate variable startIndex=0Iterate result pages(max 40 results per page)Create URL withstartIndex parameterJSON Path GET Request Ungroup Variable ConditionLoop End Table Rowto Variable Table Creator Variable Creator Math Formula(Variable) Variable Creator Extract TableDimension Generic Loop Start Table Rowto Variable String Manipulation(Variable)

Nodes

Extensions

Links