How can I make the function in external config file active?

Hi,

Now I’m working on the RPA development and I encounter the problem.
I use the external config file(excel) and the config information will be imported into dictionary<string, object> variable(Variable name:Config) once the robot started. e.g (Name:FILEPATH, Value: temp\test.txt)

If the value includes the function such as DateTime.Now.ToString(“yyyymmdd”), the function is not be evaluated in the workflow.
For example:
-In the excel sheet:
Name:FILEPATH, Value: “temp"+DateTime.Now.ToString(“yyyymmdd”)+”\test.txt"
-In workflow: Config(“FILEPATH”).ToString
Expect: temp\20180211\test.txt
Result: "temp"+DateTime.Now.ToString(“yyyymmdd”)+“test.txt”

How can I make the function in dictionary variable active?

Best Regards,
Takuya

1 Like

Hi @11115,

I have one idea.
In configuration give like this
"temp\{0}\test.txt"

fatching the data using below code.

String.Format(Config(“FILEPATH”).ToString(),DateTime.Now.ToString(“yyyymmdd”))

Regards,
Arivu

Hi Arivu,

Thank you for your suggestion.
It looks working well but is there any way to include the function in external config file?

Best Regards,
Takuya