Black Friday
Super Deal
bf 45 off
Offer ends in:
00

days day

00

hours hour

00

Mins Min

00

Secs Sec

How to use Iterator in Bit Flows to process lists of data

Estimated reading: 4 minutes 1105 views

Iterator in Bit Flows is a tool that helps process lists of data by breaking them into individual items and handling them one at a time. In this documentation, we explain how to use the Iterator in Bit Flows step by step. For this demonstration, we use WooCommerce as the trigger and Google Sheets as the action. The Iterator will process the line items from WooCommerce order creation and send each item’s data to Google Sheets. After reading this guide, users will understand how to configure and use the Iterator to process lists of data efficiently within a workflow. Once this flow is set up, each line item in a WooCommerce order will be sent as a separate entry to Google Sheets, enabling detailed record-keeping and analysis.

What is Iterator in Bit Flows?

An Iterator in Bit Flows is used to run a loop on an array of data. For example, if you are using the WooCommerce Order Created trigger, you can iterate through the line items of the order. This allows you to process each item individually and send the data to another application, such as Google Sheets, for further action.

Add Iterator to a Workflow

Open or Create a Workflow

To add a Iterator to your flow, you can either open an existing flow or create a new one by setting up your trigger and actions. Refer to this documentation to learn how to create a workflow.

Here, we already have a flow named “WooCommerceToGoogleSheet.” We will now add a Iterator to this flow.

Add Iterator to Your Flow

To add an Iterator to your flow, first go to the “Tools” section located next to “Apps.” In the Tools menu, you will find various tools. From there, drag the “Iterator” tool and drop it into your flow.

Congratulations! You have successfully added a Iterator to your flow.

Link with the Iterator

Now, to connect the Iterator with the trigger (which in this case is WooCommerce), follow these steps:

  1. Unlink the existing connection, if any.
  2. Then, connect WooCommerce to the Iterator.

This setup ensures that when an event is triggered in WooCommerce, the Iterator will process the data, evaluating each item in the list before moving forward.

Configure the Iterator

After linking the Trigger (in this case, WooCommerce) and the Iterator, you need to configure the Iterator. The Iterator essentially runs a loop through an array. To set it up, you need to specify the array from the trigger data.

To do this, click on the Iterator, which will open a popup. In the popup, under the “Array” label, click on the field and select the appropriate array. For this demonstration, we have used WooCommerce Order Create Line Items. Arrays can be identified by square brackets, like this: [].

There are also advanced options available in the Iterator. Here, you can set the “Iteration start from” and the “Maximum number of iterations.”

To configure these advanced options, simply click on the “Advanced Options” section. Once you’ve configured them, close the popup by clicking the “Close” button.

View and Map Iterator Data

To view and map Iterator data, you first need to run the trigger. Otherwise, the Iterator data will not appear when mapping to an action.

info-icon-bit-apps  INFO

If you use Iterator in your workflow, after selecting your Array, you must click on “Test Flow Once” and run the trigger. Otherwise, when mapping to your actions, Iterator data will not appear.

For example, if we add Google Sheets as an action in our workflow and try to map the fields, we won’t see any Iterator data. To see the Iterator data, first click on “Test Flow Once” to run the trigger (in this case, WooCommerce – On New Order Create Event). After that, try mapping the fields in Google Sheets again, and this time you will see the Iterator values.

Share this Doc

How to use Iterator in Bit Flows to process lists of data

Or copy link

CONTENTS