--- title: Use the While component description: Execute a code until a specified condition is true using the While component in RPA Desktop Design Studio. locale: en-US canonical_url: https://www.servicenow.com/docs/r/australia/integrate-applications/use-loops-while.html release: australia topic_type: task last_updated: "2026-03-12" reading_time_minutes: 2 breadcrumb: [Loops, Automation components, RPA Desktop Design Studio, Robotic Process Automation \(RPA\) Hub, Workflow Data Fabric] --- # Use the While component Execute a code until a specified condition is true using the While component in RPA Desktop Design Studio. Watch this video to learn how to use the While component. \[Omitted video\] Description: How to use the While component ## Before you begin Role required: none ## About this task You can configure the properties for the While component. |Property|Description| |--------|-----------| |Delay After Execution|The number of seconds to pause after running.| |Delay Before Execution|The number of seconds to pause before running.| |Delay for each execution \(Seconds\)|Specified delay before each execution of the code while the condition is true.| |Enable Timeout|Option to set a timeout value.| |Timeout|Number of seconds that the operation ends after if not completed. To apply this value, you must set the **Enable Timeout** property.| ## Procedure 1. In the Toolbox pane, navigate to **Loops** > **While**. 2. Drag the While component to the Design surface. 3. Double-click the light-yellow colored field \(\[Omitted image "expression-field.png"\] Alt text: Light-yellow-colored-field\) under the WHILE component bar. 4. Enter the condition. A Data In port is dynamically added for the parameter that contains the While condition. 5. Connect the data and control ports of the While component to the corresponding ports of the other components as described in the following table.
| Port name | Purpose of connection | Port type | Data type |
|---|---|---|---|
| The name of the port is the same as the name of the parameter that defines the condition. | Takes the value of the parameter. The component matches the value with the condition.For example, `i<=10`. | Data In | Object |
| ControlOut | Use the port at the end of the While Loop to continue to the next action flows. | Control Out | |
| LoopPort | Use the port to perform actions inside the While Loop \(such as calculating expressions, logging values, and so on\). | Control Out |