An If Statement is a powerful tool to be used with RPA. It tests the result of a logical expression, then depending on the evaluation, whether the expression is true or false, you can ask RPA to perform any number of functions.
If you want to loop through data, an If statement can help.
You can find the option for an If Statement under the Flow category on the left side of the bot.
When you need to make a logical decision, for example, you need to have RPA process a different task within your botflow depending on which user is running the botflow, you can add an If Statement and the expression builder to look in the Computer category for Windows Username.
The next Action in the botflow would be a Run Task (also located in the Flow Category) and you click the drop down to choose which task from the list of tasks you created.
If you need to RPA to run through data in a loop, an If statement will assist in moving RPA to the next line of data and also tell it when to exit the loop.
Here is an example of a scenario with an If statement and a Loop action:
You can also use an If Statement in a simpler way.
You do not need it to jump to a new task. It can stay in the main section of your botflow. You can have it evaluate the expression, for example, If YourVariable = A, this would return a True value. In the next action line in your botflow you can add the action you need.