Skyone
Skyone
English
English
  • Home
  • Data
    • Getting Started
      • Create an account
      • Recover Password
      • Quick Platform Guide
      • How to test the platform for free
      • Workspace
        • Creating a new Workspace
        • Find a Workspace
        • Sending an invitation to a Workspace
        • Editing a Workspace
      • Organizations
        • Creating an Organization
        • Organization Overview
        • Organization Management
        • Organization Monitoring
      • Settings and Preferences
        • Profile
        • Notifications
        • Usage and Billing
        • Users and Permissions
    • Modules
      • Module management
        • Creating a Module
        • Importing a Module
          • IAC Files - Integration as Code
        • Editing a module
        • Module Options
      • Settings and Operations
        • Module settings
          • Connectivity: Database
          • Connectivity: Email
          • Connectivity: REST
          • Connectivity: SOAP
          • Connectivity: File
          • Connectivity: RFC
          • Connected Account Management
        • Operations
          • Importing operations into REST Modules
          • Operation Management
        • Flows Using This Module
    • Monitoring
    • API Gateway
    • Terminals & Agent
      • Agent
        • Versions supported by Agent
        • How to Update the Agent Version
        • How to back up Agent files
      • Terminals
    • Data
      • Data Stack
        • Process Control
        • Data Stack Upload
        • File Actions
        • File Jobs
        • Data Job Parameters
        • Data Store
        • Data Share Features
        • ODBC
        • How to use the Data Engine Proxy
    • Integrations
      • Integration Management
        • Create integration
        • Import Integration
        • Edit Integration
        • Integration Options
        • Flows of this integration
      • Flows
        • Flow management
          • Creating a flow
          • Flow options
          • Flow Canva: configuring and editing the flow
            • Flow Canva: overview
            • Exception Handler
              • Exception Handler - Configuration
              • Exception Handler - Cases
            • Multicontext Flows
              • Example: Multicontext with an API Gateway
              • Example: Multicontext with a Time Trigger
            • Flow Settings
        • Triggers of a flow
          • API Gateway Triggers: Adding and Setting
          • AS2 Triggers: Adding and Setting
          • Queue Triggers: Adding and Setting
          • Flow Triggers: Adding and Setting
          • Time Triggers: Adding and Setting
          • Webhook Triggers: Adding and Setting
        • Tool Modules
          • AS2 Module
          • CSV Module
          • Data Transform Module
          • Data Balancer Module
          • EDI Module
          • Flow Call Module
          • IF Module
          • JavaScript Module
          • Log Module
          • Loop Do While Module
          • Loop For Module
          • Return Module
          • XML Module
          • Other Tool Modules
        • Module Header
        • Connecting components of a flow
        • Editing triggers and modules
        • Data Operations
          • Object Handling
            • Practical example: Handling variables
          • SMOP (Small Operations)
          • Parameterization rules
    • How to
      • Insert JSON into databases
      • Flattening: Data transformation using JSONata
      • How to use Form Data
      • Understanding recursion in JSONata
      • REST Module Output Consolidation
      • Isolated in execution: concept and application in variables
      • URL Parameters in API Gateway
      • Use case: API Gateway trigger parameters
      • Use case: Exception Handler in financial transactions
      • Use case: using Groups to manage access to flows
      • How to create a download endpoint and integrate with Power BI
      • Is it possible to use two triggers in a single flow?
      • How to set up WhatsApp in Skyone Studio
    • FAQ
    • GIGS: The complete guide
    • Glossary
  • Support
    • How do I request support?
    • Case Severity Levels
    • SLAs
    • Help & Resources
Powered by GitBook
On this page
  • Definition
  • Configuring the Loop For module
  1. Data
  2. Integrations
  3. Flows
  4. Tool Modules

Loop For Module

PreviousLoop Do While ModuleNextReturn Module

Last updated 6 months ago

Definition

The "Loop For" tool module, a default module to be used in any flow, was created to meet the need for processing data lists. It consists of two operations, Begin and End, which mark, respectively, the beginning and the end of a loop, based on an array that you must provide in JSON format.

The first operation (Begin) only takes as argument a list or array and derives the 3 FOR statements from that list. This type of statement is also known as For Each in some languages, and can be represented as follows:

for(loop_counter = 0; loop_counter < array.length ; loop_counter++){
    element = array[loop_counter]; 
	//bloco de código que será executado
} 

To represent the loop_counter and the above code element in the platform, the Begin operation from the For module initializes and holds two equivalent parameters, which can be accessed by any module connected to the flow:

  1. loopCounter: stores the flow execution position, starting from the value "0" for the first execution and increasing it with each execution

  2. element: stores the array element that is in the loopCounter position, and it is a convenient way to access the contents of each loop execution

The Begin operation of the For module will only execute the code within the flow block located between the For Begin and For End operations if the array passed as parameter is valid. If the array is empty (i.e., only "[]"), the entire block will be ignored and the execution will either move on to the next flow component after For End or simply terminate the flow execution (if there are no more operations to execute).

Configuring the Loop For module

The "Loop For" module appears in the Tools option of editing a flow. Right after the click to add it, opens the modal for configuration:

Loop For

Fill in the required Loop For fields, where:

  • List (Array): here you can either drag a parameter from the previous operations or a flow parameter, as well as manually enter an array or create an SMOP operation ( icon);

  • Validate: validates the array, displaying the complete list that will be handled in the Data Preview area.

To finish configuring the module, click on "Save".

Example

The "Loop For" module requires another module to be connected to it. See the example:

.

Definition
Configuring the Loop For module
Loop For
Example
Find out about the Module Header here