Expression Builder and Formulas

  • 15 February 2022
  • 0 replies
  • 65 views

Userlevel 1
Badge +8

Topic

 

For scenarios when you want to:

  • save a file with a name based on a date or time
  • manipulate the format of data before adding to a file
  • any other instance where you want to pull a variable

 

Instructions

 

RPA has the ability to format data, names of files and other variables.

 

As an example, if you want to download a spreadsheet and save it with a name that includes variable data, such as yesterday's date, on your desktop, you can use a formula in the expression builder.  

 

**Even if the Expression Builder is not shown, you should still be able to type a formula directly into the field for RPA to follow.

 

To save a file as a name with a date variable, such as previous weekday, you would need to use the Expression Builder. Choose Folders on the left menu to find the path you want to save it in, for example, if you want to save it on the desktop, you would select the Desktop Directory token and then type the formula below in the space where it inserts at the bottom.

 

[*Desktop_Directory]Test Name - [?RightOf([*PREVIOUS_WEEK_DAY_DATE],"/",,FALSE)]-[?LeftOf([?ZeroFillDate([*PREVIOUS_WEEK_DAY_DATE])],"/")]-[?Between([?ZeroFillDate([*PREVIOUS_WEEK_DAY_DATE])],"/","/")]

 

**Please note that Previous_Week_Day is a token as well.

 

This will save the file as: "Test Name - 2021-07-08" on the Desktop of your computer. The date will change every time you run the action to the previous week day date. 

Additional Information

 

Once you are in Expression Builder, on the left, there are 12 categories that have tokens in them that you can choose from. You can incorporate any of these into a formula to have RPA do what you need it to do.

 

For example: 

Under the Folders item you will find tokens for the different paths in your directory, such as Desktop. 

 

Under the Date & Time item you will find tokens for different versions of dates and times.

 

In the above example we had to add formulas to manipulate the tokens format to the format desired. 

 


0 replies

Be the first to reply!

Reply