# If with Do While

Hello. I have a variable with a number, and I have a condition, if at the time of capturing or get text, if that number is greater than 30, I need it to repeat an action, when I finish those actions, check again if the number of get text is greater to 30, repeat those actions again, if it is less than 30, continue to the next state or perform other different actions. I’m not sure how the logic could be, if do while is enough, if with while or if

Give a try

Variable doRepeat | Boolean - Default Value: True

Do while Activity

• get Text / other Steps
• IfActivity | Condition= x > 30
• Then: (nothing to do, log)
• Else: (newer Versions Break, older Versions: Assign Activity: doRepeat=False)

Condition: doRepeat

You can use Get Text to capture the text from element

Then you place a condition, as the GetText results is a Text, so if you are getting always the number, then you can place Cint(VariableGetText) > 30

Then → you can place which activity to repeat
Else → you can place your further activities

Thanks,
Srini

Assign
NumberVariable = GetNumber() // Your method to get the initial number

Do While (NumberVariable > 30)
Actions to be repeated
PerformActions()

``````Assign
NumberVariable = GetUpdatedNumber() // Your method to get the updated number
``````

Actions to perform when the number is no longer greater than 30
OtherActions()

Thanks & Cheers!!!

1. Initialize a variable to store the number.
2. Use a “While” loop, and set the condition to check if the number is greater than 30.
3. Inside the “While” loop, perform the actions you want to repeat.
4. After completing the actions, retrieve the number using “Get Text” or any other method.
5. Update the variable with the new number.
6. The “While” loop will continue as long as the number is greater than 30.
7. Once the number is less than or equal to 30, the “While” loop will exit, and you can continue with other actions.

Thank you