This activity allows you to apply different kinds of business logic to your workflow and execute a set of actions based on the specified conditions.
General usage example:
- Place an activity block that needs to be checked according to the desired condition. For example, you need to check if the price of something is greater than 1000.
- Save its value to a variable.
- Connect it to If...then activity and set the condition. For example, price > 1000
- Place activity blocks for True and False scenarios. For example, is the price greater than 1000? Print Yes using ‘Console log’ activity. Is it less than 1000? Print No using ‘Console log’.
Condition is the only parameter of this activity. It is a required one.
Condition parameter and its value
And this is how a complete algorithm can look like.
Here we have some value saved as a variable. We apply the ‘If...then’ check to it (if price > 1000) and output the result to the console.
An example of algorithm where If..then is used and the result in the output
price > 10 //checks if a number is greater than 10
(milk_price < 10) && (bread_price > 15) //checks if both conditions are met
ocr_data.includes('Total') // checks if data returned by an ocr engine has the word "Total"
number_in_system === user_input // checks if some number in system is of the same data type as the user input and if they are equal in values
number_in_system == user_input // checks if the values are the same if one of the variable is automatically converted to the type of the other variable