Control Flow -IF

The Smart Designer consists of a control flow package provided by the Windows Workflow. The package contains activities that help control the flow and branch the flow, based on conditions.

When to use IF

IF activity is a conditional statement used to make decisions based on a condition. It checks whether a specified condition is met and executes either of two branches (Then / else.)

IF

Figure 1

Activity Name

Picture

If

a

Technical Reference

Figure 1.1

pr 

S.no

Description

1

Define the condition that you prefer to validate

2

Display Name property shows the action that the activity performs in the workflow.

t      In condition field, define a declared variable/condition that needs to be validated.

Scenario

Assume you want to print the result by validating if the value is lesser/ greater than a defined value as displayed in this illustration.

Illustration

Let's start building the bot

Step1 - Open the SmartRPA Designer tool

Step2 - Open a new workflow

Step3  Find the ControlFlow grouping in the Toolbox, drag an IF activity into the workflow.

  • Declare a new variable datatype as Integer and enter 50 as default value for validation 

Figure 1.2

1.1

 

  • Double click the activity and define the condition to be validated in the Condition field e.g. Item<56, which implies the bot will check if Item<56.
  • Under Then branch, connect a WriteLog activity to print The given value is greater than 50 message.
  • Under Else branch, connect a WriteLog activity to print The given value is lesser than 50 message.

Example

The above-mentioned scenario uses IF activity to perform the operation.

Figure 1.3

1.2

 

Release date
Version
v4.0.0