Applying a simple logical condition
A condition needs to be added to check that the strMiddleNames
variable is not empty. There is no point in trying to get the middle name initials if there are no middle names. The following instructions will take you through the steps to achieve this:
- To assign a simple logical condition, drag the If action just below line 24.
- Set the following properties for the If action on line 25:
Condition: String condition
Source value:
$strMiddleNames$
Operator: Not equal to
Target value: (leave blank)
The properties should look like this:
- Click on Save.
All the actions that we want the bot to perform need to be placed indented within the If condition statement, similar to placing actions for loops. It gets more interesting now: within our middle names' variable, there may be one or more middle names. We just don't know this. Since we need to get the initial of each middle name, the best...