Search
⌃K

Iterators

In this section you will learn about Iterators
Iterators are a powerful tool in Jet Admin, and they can be implemented in both automation and Workflow. Here are some example use cases for an iterator:
  • Send emails with coupons to customers who left positive/negative ratings
  • Create a table that updates automatically every hour with a list of active users
  • Keep a table updated with items that are in stock at your store or online shop
  • Send a Slack message to your team when important data is updated

Implementing an iterator

Iterators can be created in automation or workflows. You can add automation in the Automation menu on the left, and workflows can be added to components in the Actions menu of a given component. Remember, workflows are activated as actions and can only be edited within the Actions menu of the component they are applied to, whereas automation is more general and good for purposes like sending Slack notifications when data changes.
  1. 1.
    Click on the Automation icon
  2. 2.
    Click on the Add automation
  3. 3.
    Choose a trigger for your automation or workflow

Add an iterator and create your automation

Add an iterator and the steps that you want to iterate over to your automation. You can also add the iterator later and drag and drop the steps into it.

Example

Iterator that iterates over every record of a table and adds info to different tables depending on the rating that the user gave:

For this specific example, it is necessary to create empty tables (with the fields that you want) in Jet Tables that records can then be added to.

Steps:

  1. 1.
    This automation is run manually, meaning that to run it, it's necessary to go to the automation menu and select Run automation.
  2. 2.
    The Xano table is accessed using the Get Record List, which the Iterator will then iterate over.
  3. 3.
    The iterator begins, using Operation Result from Run Operation - Xano.
  4. 4.
    One record of the Market Sales table is selected, then the Yes/No function sorts it. In this example, Yes is if the customer left a rating of higher than or equal to 5, and No is if the rating is lower than 5. Note: If you do not see the Iterator in the menu of steps, click Test Automation, and then try again.
  5. 5.
    If the user has left a rating of more than 5/10, certain info from the record is added to the table with the information from higher-rated transactions. If not, that info is added to the other table, with the information from lower-rated transactions. In this example, a label of high rating/low rating has also been included, but in this case, it is chosen by the user when setting up the automation. Note: As before, if certain options are not available in the menu, click Test Automation and try again.
  6. 6.
    Iterator moves on to the next record.
  7. 7.
    Once you've completed your automation, be sure to click save it!