Skip to main content
?

if

Summary

This Action returns values that fits the condition.

Description

The IF statement executes a statement if a specified condition is truthy.
If the condition is false, another statement in the optional ELSE-IF clause will be executed.

Fields

In IF Action there are 3 type fields.

  • IF : To check condition
  • return : Return result If the condition is True
  • ELSE-IF : Add more IF condition
Version Location

- IF

This field is to check If condiion.
Basically, default is 'Boolean Type'.
Also, you can change the type to 'References Data', 'Action', 'Condtions', 'Comparisons' like below.

Version Location

- return

This field determines how to return the value that returns when the if statement is true.
You can change the type to 'Values (string, number...)', 'References Data', 'Action' ...' like below.

Version Location

- Add ELSE-IF

This field to use when you want to add more if statements.
Click to add more else-if statements, as shown below.

Version Location
tip

If you add Else-if and set the boolean true value in ELSE-IF field,
the return value can be set to a value that comes out as default in the if statement.

Example

Let's See how to use IF Action!

Using Comparisons

Let's imagine.
I want to make an if statement true only when data with reference data is data that meets the criteria I set.

goal

We will put the string 'Autoflow' in the ref_data,
the value to true only if the ref_data coming through the if statement is 'Autoflow'.

We will get Action result like below.

  • If condition is true, it would return True Result!
  • If condition is false, it would return False Result!

1. Prepare Reference Data

We will make Reference Data by 'Variable/set Action'

I just add value as String, then I put 'Autoflow' in value.
Then I changed OUTPUT's name to 'ref_data'

Version Location

2. Change IF Action's Conditon.

I just Click 'boolean' in IF field, Then Click 'equal'

Version Location

Then Click 'number' in IF field.

Version Location

Then Click 'data' button.

Version Location

Change Scope and Path as variable > ref_data

Version Location

Then Click 'number' in IF field.

Version Location

Then Click 'string'

Version Location

We are ready to Comparison to use IF Action now! 👏

Version Location

3. Setting return field.

Click null in return field, then click string

Version Location

Write True Result! in return field in string ,
Then click Add ELSE-IF field to add default

Version Location

Write False Result! in return field in string ,

Version Location

We are ready to get result to use IF Action now! 👏


4. Get a result by using Simulation!

Start Simulation, then See the result! 👀

tip

You don't know how to use Simulation in Autoflow?
Then, Click here! 🔗

Version Location

I put comparison string to Autoflow and ref_data is Autoflow.
That means I will get True result from IF Action.

Now we can see True Result! in Action output.👀

Version Location

I put comparison string to eric and ref_data is Autoflow.
That means I will get False result from IF Action.

Also we can see False Result! in Action output.👀

Version Location