While

Estimated reading: 2 minutes

The While activity enables you to repeatedly execute a set of operations as long as a specified condition evaluates to True. It is particularly useful for scenarios where the number of iterations depends on the condition.

Structure

The While activity contains two main sections:

a. Condition: Defines a Boolean value (True or False) that controls whether the loop should continue.
b. Body: Contains all activities that are executed repeatedly while the condition is True.

Properties

DisplayName: Displays the name of the activity. This can be customized to improve readability and troubleshooting.

Condition: Accepts only a Boolean value (True or False) to control loop execution.

How While Activity Works

On the workflow canvas, the While activity is divided into Condition and Body sections.

Component Overview Behavior
Condition Defines whether the loop should run using True or False. If True, the loop executes. If False, the loop stops.
Body Contains activities to be executed repeatedly. Executes continuously as long as the condition remains True. Stops when it becomes False.

Example: Using While Activity

This example shows how the While activity executes based on a Boolean condition.

Steps:

1. Add the While activity to a new workflow.
2. Define the Condition as True.
3. Add a Write Line activity with the text “Running Loop” in the Body section.

Result: The loop executes repeatedly while the condition is True and stops when the condition is set to False.

Share this Doc

While

Or copy link

CONTENTS
Robility Chatbot
Robility Assistant
Online