Icon

07_​Modified Variables Propagation in GET Request Nested Loop

Modified Variables Propagation in GET Request Nested Loop

This workflow demostrates the use of the option "Propagate modified loop variables" available in Loop End nodes.
Given a list of search terms, the workflow iterates over each search item to avoid overloading (outer loop) and then it sends GET request to the Google Books API for each search term to get the relevant book authors and titles. The maximum results in Google Books API is 40, therefore, for each search term, the workflow repeats sending GET requests untill the starting index of an item (a book) is larger than the total number of available items for this search term (inner loop).

The workflow demonstrates the difference for external, injected, and internal variables as well as the difference between the propagation option on (in the inner loop) and off (in the outer loop).

This workflow uses Google Books API to get the titles and the authors for the books corresponding to the provided search terms. 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:1. Inner loop:was modified at each iteration, its modified value was propagated to the LoopStart at each iteration and exported from the loop body.2. Outer loop:was modified at each iteration, each iteration started with the initial value.Unmodified value was exported from the loop body.Injected variable base_url:1. Inner loop:was modified in the loop body but wasn't propagated each time to the LoopStart and was exported modified according to the last iteration2. Outer loop:Wasn't propagated to the loop start; unmodified value was exported. Internal variable totalItems:1. Inner loop:was created inside the loop body, wasn't propagated to the Loop Start andwasn't exported. External variable-Updated in the inner loop, its modified value is propagated tothe inner loop start-Not propagated in the outer loop - outer loop starts eachiteration with the initial value Send requestto API Propagate modified loop variablesoption is enabledCreate variabletotal items with total numberof results availableProvide a listof search termsCreate base URLfor Google Books APIincrement startIndexadding number of resultsof this iterationIterate result pages(max 40 results per page)Create URL withstartIndex parameterIterate over thesearch termsCreate variable startIndex=0Propagate modified loop variablesoption is disabledJSON Path GET Request Ungroup Variable ConditionLoop End Table Rowto Variable Table Creator Variable Creator Math Formula(Variable) Extract TableDimension Generic Loop Start Table Rowto Variable String Manipulation(Variable) Chunk Loop Start Variable Creator Loop End This workflow uses Google Books API to get the titles and the authors for the books corresponding to the provided search terms. 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:1. Inner loop:was modified at each iteration, its modified value was propagated to the LoopStart at each iteration and exported from the loop body.2. Outer loop:was modified at each iteration, each iteration started with the initial value.Unmodified value was exported from the loop body.Injected variable base_url:1. Inner loop:was modified in the loop body but wasn't propagated each time to the LoopStart and was exported modified according to the last iteration2. Outer loop:Wasn't propagated to the loop start; unmodified value was exported. Internal variable totalItems:1. Inner loop:was created inside the loop body, wasn't propagated to the Loop Start andwasn't exported. External variable-Updated in the inner loop, its modified value is propagated tothe inner loop start-Not propagated in the outer loop - outer loop starts eachiteration with the initial value Send requestto API Propagate modified loop variablesoption is enabledCreate variabletotal items with total numberof results availableProvide a listof search termsCreate base URLfor Google Books APIincrement startIndexadding number of resultsof this iterationIterate result pages(max 40 results per page)Create URL withstartIndex parameterIterate over thesearch termsCreate variable startIndex=0Propagate modified loop variablesoption is disabledJSON Path GET Request Ungroup Variable ConditionLoop End Table Rowto Variable Table Creator Variable Creator Math Formula(Variable) Extract TableDimension Generic Loop Start Table Rowto Variable String Manipulation(Variable) Chunk Loop Start Variable Creator Loop End

Nodes

Extensions

Links