Skip to content

Case CSV

Purpose

By including loops into your automation, you can easily automate repetitive tasks. Yarado can run tasks in loop mode by loading the default loop file at launch. However, there are many cases where it's necessary to load a loop file dynamically or based on business logic. For those situations, Yarado offers the Case CSV function.

The Case CSV function allows you to dynamically load a task's loop file based on the outcome of an IF-statement. Meaning, your predefined criteria must be met before your .csv file is loaded as loop file.

Case CSV

Double click the icon or drag it to the process visuliser to use the Case CSV function.

Using Case CSV

The Case CSV step is a step that must be created manually because it is not possible to provide the decision criteria when you are in recording mode.

Interface elements

Element Description
1. Select Variable Select the corresponding variable.
2. Equals/Contains When testing, define whether the variable should equal (fully match) or contain (partially match) the value.
3. Case sensitivity Checking this box will enable case sensitivity, meaning that Yarado will differentiate between UPPER and lowercase characters.
4. Value to match Select the value or variable to test against.
5. CSV file path Define the file path of the .csv file Yarado should load as loop file if the logic test is passed.

Case CSV interface

Variable based interface elements of Case CSV.

Adding or deleting rules

Once you have configured your rule, click on Add rule to confirm and enter it into the list of rules.

To delete a rule, you first need to select the row you want to delete. You can do so by left-clicking in the most left column of the rules table. If you do so, the row you have selected will light up blue. Then you can right-click to delete the select row or press Delete on your keyboard.

Delete Case CSV rule

Deleting a rule.

Example

Loading a CSV based on a variable value

Case CSV are usually part of more complex task flows, where the steps leading up the Case CSV steps create or append the loop file that will be loaded in the Case CSV step. To keep this example as clear as possible, it's contained to just four Yarado steps.

For this example, we will use a count variable and a value for the trigger in the Case CSV.

  1. Create two variables:

    • %count% to match against later on.
    • %filepath% for the .csv file you want to load.

    Case CSV example

    Variables used in this example.

  2. Open a text editor such as Notepad and a create a .csv file with three lines:

    1
    2
    3
    

    • Make sure you hit Enter one more time after typing "3"; otherwise Yarado will only interpret the first two lines of the loop file.
    • Save this file to a location on your machine's main disk.
    • Enter the filepath of this file as Variable Value for %filepath%.
  3. Add a Hidden Command step with the following argument:

    Find /V /C "" < "%filepath%"
    
    This command will count the number of lines in the .csv file you have just created.

    Case CSV example

    Hidden Command step used in this example.

    • Use %count% as the output variable for this step.
    • Click on OK to save the step.
  4. Add a Case CSV step with the following settings:

    Case CSV example

    Case CSV step used in this example.

    • Click on Add rule and OK to save the step.
  5. Add an Execute Program step with the following settings:

    Case CSV example

    Execute Command step used in this example.

    • Click on OK to save the step.
  6. Add a Close Application funtion step with the following settings:

    Case CSV example

    Close Application function step used in this example.

    • Click on OK to save the step.
  7. Start the loop file at step 3.1 by right clicking on the step and clicking on Steploop → Steploop Start. Repeat this for step 4.1, but click Steploop End here instead of Start.

    Case CSV example

    Steploop Start.

  8. Run the task in loop mode and you will see that your .csv is loaded as loop file, while Yarado loops through opening and closing Edge.