Group (Loop) Functionalities in Platform NX

Introduction

This page provides an overview of the loop functionalities available on our Platform NX platform.

These functionalities allow developers to automate repetitive tasks within their APIs by using various types of loops. Each loop type is designed to suit different scenarios and requirements, enhancing both flexibility and efficiency in API development.

Loop – Group Action Overview

Loops in our platform are designed to handle multiple iterations of a set of activities based on specific conditions. They are essential for processing collections of data, repeating operations, and automating workflows.

Types of Group Actions:

  • For Each Loop

  • While Loop

  • Repeat Until True (RUT) Loop

For Each Loop

The For Each loop iterates over variables in an array. The array to iterate over is specified in the 'Iterate On' field of the group configuration and can be sourced from any activity’s output prior to the start of the loop. This loop is ideal for operations where each item in a collection needs to be processed individually.

Usage: Use the For Each loop when you need to execute a block of activities for each variable in a specified array.

Configuration Options:

Variable Naming: Assign a name to each variable within the array to be used in subsequent activities.

Field
Required
Description

Iterate On

Yes

Specifies the array from which variables are derived.

Variable Name

Yes

Name assigned to each iterated variable.

Index

Yes

Specifies the position of current item.

Start index

Yes

Starting position of loop.

Step

Yes

Increment of loop.

Configuration Example

Mapping Example

While Loop

The While loop repeatedly executes a group of activities as long as a specified condition remains false. This condition can be dynamic and utilize the output of activities within the group.

Usage: Suitable for scenarios where the number of iterations is not known in advance and the continuation condition is evaluated at the start of each iteration.

Configuration Options: Condition Field: Set the condition that controls the loop execution.

Field
Required
Description

Condition

Yes

Condition that must be true to break the loop.

Index

Yes

Specifies the position of current item.

Configuration Example

Advanced Configuration

Output Step: Select the Activity within the group whose output will be considered the result of the loop.

Accumulate Output: If checked the output from each iteration of the chosen Output Step will be accumulated and made available as an array to subsequent activities. For Example,

Use Cases

How to make a Group

Select the activities to group.

Click on the group icon from the tool grid present in the canvas area.

Output of group after Using Accumulate or without Accumulate

an Case 1. If you use accumulate, it provides data in array which contains all outputs from each iteration

Case 2. If you don’t use accumulate, it provides data of only last iteration.

Last updated