Campaign Standard: How to concatenate a text string and a date function in the “Output file”

Learn how to concatenate a text string and a date function in the Output file by using a content block created with the formatDate() function.

Description description

It has been asked if it is possible to concatenate a text string and a date function in the “Output file” of a workflow “Extract file” activity. The use case for this is that the daily file needed to be updated with a specific date and format every day.

Resolution resolution

To resolve this a content block should be created with the formatDate() function. Below is an example of this method.

< %
var now = new Date();

var sToDisp = now.getFullYear() + ("0"+(now.getMonth()+1)).slice(-2) + ("0" + now.getDate()).slice(-2);document.write(sToDisp);%>

In this content block, the formatDate() is available

Then in the extraction file activity, open the Edit file name (The pencil icon is on the right side of the file name field) and add a Content block in the file name.

recommendation-more-help
3d58f420-19b5-47a0-a122-5c9dab55ec7f