Getting started - Advanced If

Advanced If

Often in automation decisions must be made based on condition to add business logic to tasks. To Support this logic, within the Yarado toolbox an Advanced IF function can be found.
Besides business logic, “for each” and “do while” loops can also be created wit this.

Flow Charting
Converting a Flowchart into Process visualizer
image image

Variable Conditions

  1. If / If Not, select the type of condition

  2. Select on what the condition is applicable: variable, clipboard or file
    a) If/Not Variable Equals / Contains
    b) If/Not Clipboard Equals / Contains
    c) If/Not File Exists

  3. Select the variable from the list, if no variable exists first create one

  4. Equals or contains, where equals must have an exact match, the contains support part of the text

  5. Type the value to match, or select a variable from the list

  6. Define if Case Sensitive is Applicable (Differentiate between Upper end lowercase characters)

  7. Select What to do (Next Step Down / Next Step Right)

  8. Add Rule to list

  1. If / If Not, select the type of condition

  2. Select on what the condition is applicable: variable, clipboard or file
    a) If/Not Variable Equals / Contains
    b) If/Not Clipboard Equals / Contains
    c) If/Not File Exists

  3. Equals or contains, where equals must have an exact match, the contains support part of the text

  4. Type the value to match, or select a variable from the list

  5. Define if Case Sensitive is Applicable (Differentiate between Upper end lowercase characters)

  6. Select What to do (Next Step Down / Next Step Right)

  7. Add Rule to list

  1. If / If Not, select the type of condition

  2. Select on what the condition is applicable: variable, clipboard or file
    a) If/Not Variable Equals / Contains
    b) If/Not Clipboard Equals / Contains
    c) If/Not File Exists

  3. Enter the path of the file to check or click 4) Browse

  4. Use brose to browse for the file

  5. Select What to do (Next Step Down / Next Step Right)

Tip : Multiple Conditions can be stacked to reduce complexity, the first condition that is a match will be followed

Exercise 1: Bananas or ?

Start the Yarado Client, if Already started Create a new Task File --> New

Create a new variable named : fruits


Click in the Variable Value and Enter “bananas”


Double Click on advanced If to Add the step

Copy the entered values in the screenshot and click Add rule


Click Ok

On Default an insert Container is placed, any step inserted now will be placed in the container. Double Click Message Box to add the step for right

Tip: When an insert step is active, any next step inserted will be placed in the insert container. When starting Recording modes, the first recorded step will be placed into the inserted container.
**All the next steps in the recorded session will be placed right below the first step, making it possible to insert a complete recording sequence.

image
The message Box Step is used for User interaction, giving information or getting a answer to Questions interactive automation is supported.

  1. Ttilebar: The text in the Titlebar, set it to Bananas
  2. Icon Type: Information, Error, Warning, QuestionMark, select default Informational
  3. Left Button : Any Text can be set on the buttons, use default OK
  4. Right Button : Any Text van be set on the button, use default Cancel
  5. Enter text to display in the message : Set Fruit is bananas (variables can also be use here)
  6. Select the location of the message on the screen : Center
  7. Select if we would like to fetch which button the user clicked and store it, leave it off
  8. Select into which variable to button click info is stored, skip
  9. Autoclose : Select when to Autoclose the message, necessary when tasks are scheduled unattended. Set to 3 seconds
  10. Click OK

Notice the green Arrow, this is the Active Column under step 1.2

Click on 1.1 to Activate this Column

Tip : If a Column has an open ending, clicking on it will activate this Column active column is indicated with the green arrow below the steps within the active column, new steps will automatically added to the active column

Double Click Message Box, and copy the above settings click OK when done.


Now Start the Task

Result Should Be
image


Change the Variable value fruits to apples

Start the Task again
image
Result Should Be

Notice the variable value of %fruits% is mapped to the text of the message box
Save the task to bananas.tsk

Exercise 2: Apples, Bananas, Other
Load Task From Exercise 1, or continue.

image
Right Click Step 2.1 And select Insert


Double Click Advanced If,
Copy The Values in the printscreen
If Variable %fruits% Equals “apples” The Next Step Right

Click Add Rule

Click Ok


Double Click Message Box to add a step
Copy the values from the screenshot above

Click OK to save the step

Click Play to start the task.
image


Double Click 3.1 MSG and adjust Message, add no bananas and no apples.


Change the variable fruits : to apples,bananas,mango and test the task inbetween.

Save the task

Exercise 3: Do While count is not 10 loop
In Yarado Client select File --> New, or start Yarado client when it is not started yet.

Create a new variable count and set it to value 0

Goto Functions --> text --> Copy To


Double Click Copy to


Value 0, output %count) Click OK


Click Ok

Goto Functions --> Math --> Add 1

Double Click Add1, copy settings from the screen above
Select variable : %count%
Select out variable : %count%
Click Ok,Ok


Double Click Advanced If, copy settings from the above screen :
If variable %count% Equals 10 Then Next Step Down.
Click Add Rule
Click Ok


Double Click Message Box, copy the settings from screen
TitleBar : Count Lines
Message : Count no : %count%
AutoClose : 2
Click Ok


Right Click on step 3.2, Select Conditions --> Goto


Now Click on Step 2.1


A Goto line should be visible

Start the Task.

image
Result Should be a 10 times count down timer