If
The If action An instruction within a botflow. adds an If Statement to botflows Automated steps that you can design for each bot that will run. executing or skipping a sequence of actions depending on a specific condition.
Use If statements to configure botflows to check:
- If one value matches another value, or set of values.
- If a target An element within an application Nintex RPA LE interacts with, such as a button, text field, or checkbox. (such as a message box) appears on the screen.
- If a target (such as a listbox) contains a specific number of items.
- If a target (such as a checkbox) is selected.
- If a table highlight is in a specific location.
Add an If action to a botflow using the:
- Project Pane if the If action does not require a target.
- Target Target Selector if the If action requires a target.
Also review:
- If action field and button descriptions.
- Comparison option descriptions.
- If statement configuration descriptions.
Add an If action to a botflow using the Project Pane
This example provides the steps necessary to add an If action to a botflow using the Project Pane.
To add an If action to a botflow:
- On the Actions list, click Flow and then click If from the Logic list.
- The If Action Builder window displays.
- Set the If settings.
- More/Less view: Click the More/Less toggle to include or exclude multiple If statements.
- If: Select the first half of the If group statement from the drop-down list.
- Of these are: Select the second half of the If group statement from the drop-down list.
- Plus Sign: Select to add a Condition or Group to the If statement.
- Condition (number): Type a value to compare in the first box. Select the comparison from the drop-down list. Type a value in the second box to compare against the value in the first box.
- If needed, click the Rules checkmark.
- Include "Else": Check to include an Else clause in the If statement.
- If needed, adjust the Run Switch setting to create the action without running it.
- Optionally, add an action note.
- Click OK to add the If action to the botflow.
Add an If action to a botflow using the Target Tool
This example provides the steps necessary to add an If action to a botflow using the Target Selector.
To add an If action to a botflow:
- Drag the Target Selector from the Build Pane Area to add new actions and edit existing actions. The Build Pane displays after you select a targeted element in a Windows application. The center of the Build Pane is referred to as the Task Editor Pane. and drop it onto an application to display the Target Preview.
- Click If from the Logic list.
The If Action Builder window displays.
- Set the If settings.
- More/Less view: Click the More/Less toggle to include or exclude multiple If statements.
- If: Select the first half of the If group statement from the drop-down list:
- Of these are: Select the second half of the If group statement from the drop-down list:
- Plus Sign: Select to add a Condition or Group to the If statement.
- Condition (number): Type a value to compare in the first box. Select the comparison from the drop-down list. Type a value in the second box to compare against the value in the first box.
- If needed, click the Rules checkmark.
-
Include "Else": Check to include an Else clause in the If statement.
- If needed, adjust the Rule settings to modify how Nintex Bot finds the application target.
- If needed, adjust the Timing settings to fine tune how the action runs.
- View the action Details settings.
- If needed, adjust the Run Switch setting to create the action without running it.
- Optionally, add an action note.
- Click OK to add the If action to the botflow.
If Action Builder field and button descriptions
Field or button | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Target Selector |
The Target Selector allows you to choose the target element the botflow interacts with, such as a button, text field, or check box. Ensure that your machine's Windows Settings (Start Menu > Settings) are set as follows when using the Target Selector:
You can use the Target Selector to:
Drag the Target Selector from the Task Pane onto the desired application target An element within an application Nintex RPA LE interacts with, such as a button, text field, or checkbox. and select the appropriate action from the Build Pane Area to add new actions and edit existing actions. The Build Pane displays after you select a targeted element in a Windows application. The center of the Build Pane is referred to as the Task Editor Pane.. Smart Target and Screen Target options The Target Selector can be used with the Smart Target or Screen Target options. The options are displayed as shown in the image below. Smart Target is selected by default.
The following options are available:
|
||||||||||||||||||
Build Pane |
The Build Pane displays after you select a targeted element in a Windows application. In the Build Pane, you can:
Selected target elements display in the Build Pane with a list of actions supported by the targeted item. The Build Pane also displays how long the item has been targeted.
Build Pane rules
Tip: Comparing Text and Numeric
variables: Tip: Check Remove ampersands when targeting a shortcut key. When displayed as a menu item or button, where it can be partially underlined, an ampersand often takes the place of the partial underline in shortcut keys. |
||||||||||||||||||
Recent Target |
The most recent target may be accessed by clicking the Recent Target button to the right of the Target Selector.
This is useful when creating Excel, Emulator, and Web Table Targets allowing you to create new actions with existing targets. |
Field or button | Description |
---|---|
Action Builder Options/Settings | General
More/Less view: Click the More/Less toggle to include or exclude multiple If statements.
Options
Preview: Provides a live true or false evaluation of the If statement. |
Target Selector Options/Settings | General
More/Less view: Click the More/Less toggle to include or exclude multiple If statements.
Options
|
Rules |
Some actions have rules required to locate a target and vary based on the targeted application. Rules of a targeted application element are configured and saved with the action. The rules are then used to locate the proper targeted element, such as an Microsoft Excel workbook. Common rules To set the most common rule type:
The Rules window displays the Rules available for the selected target application.
Alternatively, use the Expression Builder to build your action rules.
|
Preview | All actions created using the Target Selector include a preview of the targeted element. |
Details |
When directed by Nintex Support, click Details from the Preview Panel of the Action Builder. If needed, Nintex Support will supply additional information. |
Timing Settings |
Some actions have timing settings and vary based on the targeted application. The timing settings of a targeted application element are configured and saved with the action. The timing settings are then used to control when the action starts.
|
Run error task |
|
Note |
(Optional) Type a Note to document any special instructions or functionality.
|
Run Switch |
The Run Switch toggle controls how Nintex Bot runs an action when adding or editing an action in a botflow.
|
OK/Cancel | Click OK to save the action or click Cancel to discard the action or any changes. |
Comparison option descriptions
Comparison statement | Returns true |
---|---|
is found |
The target appears on the screen |
is not found |
The target does not appear on the screen |
Comparison statement | Returns true |
---|---|
is blank |
The item to compare is blank |
is not blank |
The item to compare is not blank |
is numeric |
The item to compare is numeric, and does not contain any alphabetic characters |
is not numeric |
The item to compare is not numeric, or contains at least one alphabetic character |
is equal to |
The two items are equal |
is not equal to |
The two items are not equal |
is greater than |
The first item is greater than the second item |
is greater than or equal to |
The first item is greater than or equal to the second item |
is less than |
The first item is less than the second item |
is less than or equal to |
The first item is less than or equal to the second item |
contains |
The first item contains the second item |
does not contain |
The first item does not contain the second item |
begins with |
The first item begins with the second item |
does not begin with |
The first item does not begin with the second item |
ends with |
The first item ends with the second item |
does not end with |
The first item does not end with the second item |
Comparison statement | Returns true |
---|---|
is in the First Row |
The highlight is in the first row |
is in the Last Row |
The highlight is in the last row |
is in the First Column |
The highlight is in the first column |
is in the Last Column |
The highlight is in the last column |
is not in the First Row |
The highlight is not in the first row |
is not in the Last Row |
The highlight is not in the last row |
is not in the First Column |
The highlight is not in the first column |
is not in the Last Column |
The highlight is not in the last column |
If statement configuration descriptions
Button | Description |
---|---|
More/Less toggle | More displays by default in Expert and Professional mode. Less displays by default in Beginner mode. Click to toggle between More and Less. |
Add Condition | With More enabled, click Plus and then click Add Condition. |
Add Group | With More enabled, click Plus and then click Add Group. |
A Condition is a single statement to be evaluated.
Example: A condition evaluates a MaxValue Variable against 50. A second condition evaluates a MinValue Variable against 25. The If Statement enters when both Conditions are true.
A Group consists of one or many conditions to be evaluated.
Example: A first group evaluates two Conditions, while a second group evaluates a single condition. The If Statement enters when all of the conditions are true.
The following Group Options are available:
- All of these are True or False
- Any of these are True or False
- None of these are True or False
Note:
- If
the If
action evaluates as True, the actions under the If action execute.
- If
the If
action evaluates as False, the actions under the If action do not execute.
- For Complex statements when the If
action evaluates as False, the actions under the Else statement execute.
An Else statement is a statement entered when the superseding If statement evaluates as False. If the Else option is selected, and the If action evaluates as False, the Actions under Else execute.
Example: If 1 is equal to 2, perform Action 1, Else perform Action 2.
Because 1 never equals 2, Action 1 between If and Else is skipped and Action 2 between Else and End If executes.