Skip to main content
Level 2
Jul 9, 2020 9:58 AM UTC
Solved

Replace file collector hard coded folder path with options

Hi All,

 

I have used hard coded path such as: In a workflow, in file collector,I have used folder path to pick from D:\FolderX\QA\xyz\ 

 

Now, the following changes need to be done:
  1. This path should be in option - folderPath: D:\FolderX\<environmentVariable>\xyz\
  2. QA should be in another option variable, that defines environment i.e, environmentVariable.

I tried with this approach:

 

By assiigning the option folderPath with this value -> 

D:\FolderX\<%= getOption("environmentVariable") %>\xyz\ 

 

and called <%= getOption("folderPath") %> in File collector activity. But, it threw error. Maybe the text value is not looking for the script and instead takes as only a text value.

 

Could you please help me achieve this. 

 

Thank you,

Anoop

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Manoj_Kumar
Manoj_KumarAccepted solution
Community Advisor
Jul 9, 2020 10:12 AM UTC

Hello @anoopa24021992 ,

 

Use a javascript activity in your workflow and save the value of getOption in that variable and then call the variable where you are calling the getOption.

 

So in your javascript code, You will write.

vars.envVariable=getOption("environmentVariable");

 

and the path variable, you can use this.

D:\FolderX\<%= vars.envVariable %>\xyz\

 

Let me know if that helps.

 

Thanks,

 

 

 

Manoj  | https://themartech.pro

2 replies

Manoj_Kumar
Community Advisor
Manoj_KumarCommunity AdvisorAccepted solution
Community Advisor
Jul 9, 2020 10:12 AM UTC

Hello @anoopa24021992 ,

 

Use a javascript activity in your workflow and save the value of getOption in that variable and then call the variable where you are calling the getOption.

 

So in your javascript code, You will write.

vars.envVariable=getOption("environmentVariable");

 

and the path variable, you can use this.

D:\FolderX\<%= vars.envVariable %>\xyz\

 

Let me know if that helps.

 

Thanks,

 

 

 

Translate
Manoj  | https://themartech.pro
Level 2
Jul 9, 2020 11:06 AM UTC
Thank you @_manoj_kumar_. Your logic worked!
Translate