How can I pass the workflow name as the file name for a data output tool? | Community
Skip to main content
NJT562
Level 2
December 9, 2021
Solved

How can I pass the workflow name as the file name for a data output tool?

  • December 9, 2021
  • 1 reply
  • 1592 views

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. 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

David_Loyd
Adobe Employee
David_LoydAdobe EmployeeAccepted solution
Adobe Employee
December 9, 2021
NJT562
NJT562Author
Level 2
December 9, 2021

Where can I find a list of all the  instance.vars? 

NJT562
NJT562Author
Level 2
December 9, 2021

Essentially any data in ACC is available to used. You just have to build the correct data context.

Check the ACC docs on JS vars: https://experienceleague.adobe.com/docs/campaign-classic/using/automating-with-workflows/advanced-management/javascript-scripts-and-templates.html?lang=en

 

Clicking on this drop down icon will give you a menu of options. 

 

 

 


Cool thanks! In case anyone else has a similar question the format of the JS that worked to get my workflow name as my file name was this.

 

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