How to mix variables and fields?

I’m having an issue trying to create an Excel file in a folder that still does not exist. My idea was create the folder using the Modified Java Script Value, I tried to use ${Internal.Entry.Current.Directory} into the script, but it’s seems to be just a string there, not the value of the variable. I’ve also tried to make that variable a field, so I could use in the script, but I didn’t find a way to merge the fields I had with the field I was creating.
image
In my case I just want to create the output folder into my process folder, like: C:\myProjectPath\Output. I have also tried to use the relative path, but the folder is created in process-studio-5.3.0 installation folder.

So how can I achieve that? Is that possible to mix variables and fields?

Hi Matheus,

You can achieve this by creating a run-time parameter at the workflow level like below:
Parameter DisplayName Type Runtime Secret Optional DefaultValue
OutputFileLocation OutputFile String false false false ${Internal.Entry.Current.Directory}/Output

Then use “Get Variables” step to make run-time parameter available in workflow stream Like below:
Name Variable Type
OutputFilePath ${OutputFileLocation} String

Then in “Modified Java Script value” step, write script as below:
createFolder(OutputFilePath);

It will create a folder in the current directory.
Thank you

1 Like