Skip to main content

12.05 Using the Iterator node

tip

You can watch a training video here.

As an example of using the Iterator node, let's create a scenario that results in an array of document names located in the Latenode Google Drive folder.

To successfully run the script, you need to add 5 nodes:

  • (1) Trigger on Run once node to initiate a single scenario run immediately after clicking the Run Once button;
  • (2) A ListFiles node that provides information about the documents located in the Latenode Google Drive folder in the form of an array. To configure the ListFiles node correctly, you need to create a authorization, select Google Drive, and choose the desired folder:
  • (3) An Iterator node containing a sequence of values from the ListFiles node;
  • (4) A SetVariables node that collects a variable as an array of document names. When configuring the SetVariables node, it is important to correctly specify the variable collection algorithm using the "add" operator:

The operand of the expression will automatically be the specified variable;

The expression's value should be selected as the "name" value from the Iterator node.

  • (5) A Webhook Response node that returns the specified variable.

The result of running the script will be an array of values: