Support Portal

for ProcessRobot and WinAutomation

Start a new topic
Answered

Set a variable using a text string from a data table

I have created a job in WA that reads a data table in Excel.  The data table has a list of regular expressions in one column and a list of variable names (ex %Variable_Name%) in another column.  I would like to be able to send the regex string to a function and in the function a big text file would be parsed using the regex and then I would like to be able to put the result in a variable (the name that was in the second column)  But I can't figure out a way to set a variable by referring to the variable name through a different variable.  Is there any way to do that?


Thank you in advance


Ron Pero


Best Answer

Hello Ron,


Unfortunately creating variables dynamically, meaning having the process decide the variable name on the spot based on outside input such as the Excel file data, is not supported.


As a workaround, we could use objects instead of simple variables, as shown in the screenshot below.



Then, since we will be creating many objects, we need to add the object in a list, so that we can access it later, using the dot notation as follows.


%List[Index].Name% and %List[Index].Value%



New Object.PNG
(19.3 KB)

Hey Ron


I wanted to do something similar a year ago, and this was the support response from the dear Konstantinos:


"Please note that this functionality is not supported by ProcessRobot due to the fact that the values we read from the excel file are text based."


So it seems it can't be done, unfortunately...


Have a good day ^^


ADMIN
Answer

Hello Ron,


Unfortunately creating variables dynamically, meaning having the process decide the variable name on the spot based on outside input such as the Excel file data, is not supported.


As a workaround, we could use objects instead of simple variables, as shown in the screenshot below.



Then, since we will be creating many objects, we need to add the object in a list, so that we can access it later, using the dot notation as follows.


%List[Index].Name% and %List[Index].Value%



New Object.PNG
(19.3 KB)

Hello George, 

Thank you for getting back to me. It looks to me like the ability to create a custom object must be somethign that has come along in newer versions of WA.  I actually still use version 5 belive it or not.


I am just a small time, one person small buiness person and so it would not be cost effective for me to upgrade to version 8 since it is cloud based and requires a monthly subscription.  


Softmotive no longer offers any type of PC based version of WA that can be just purchased similar to how it worked in version 5 is there?  If there was an option like that available I would definitley like to buy it.  I still use my version 5 setup very frequiently to automate tasks that I do for my small business.


Thanks,

Ron Pero

Login or Signup to post a comment