Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Replace file collector hard coded folder path with options

Avatar

Avatar
Validate 1
Level 1
anoopa24021992
Level 1

Likes

3 likes

Total Posts

18 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 1
anoopa24021992
Level 1

Likes

3 likes

Total Posts

18 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
View profile
anoopa24021992
Level 1

09-07-2020

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

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
MVP
_Manoj_Kumar
MVP

Likes

104 likes

Total Posts

302 posts

Correct Reply

97 solutions
Top badges earned
Validate 1
Contributor
Ignite 1
Shape 1
Give Back 5
View profile

Avatar
Validate 1
MVP
_Manoj_Kumar
MVP

Likes

104 likes

Total Posts

302 posts

Correct Reply

97 solutions
Top badges earned
Validate 1
Contributor
Ignite 1
Shape 1
Give Back 5
View profile
_Manoj_Kumar
MVP

09-07-2020

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,

 

 

 

Answers (0)