Avatar

Level 2

I created this in the step before the the output tool and it will pick up the file name I put there but I have to manually enter it. I want it to pickup the workflow name automatically so I don't have to edit that step.

 

vars.fileName="WorkFlowName" + "_" + formatDate(new Date(),"%4Y%2M%2D") + ".txt"; 

 

I tried this:

vars.fileName=<%= vars.workflowName %> + "_" + formatDate(new Date(),"%4Y%2M%2D") + ".txt"; 

which works in my Alert step but generates undefined in the file name. 

And this:

vars.fileName=vars.workflowName + "_" + formatDate(new Date(),"%4Y%2M%2D") + ".txt"; 

but it generates undefined_20211209.txt as well. 

 

Anyone have any experience with this, I'll admit I don't know javascript at all.