Is there a way to change the name of an output file? For example my current output is called WorkingPaper.xlsx. However I would like to add the current month and year in front of this.
Solved! Go to Solution.
Hi garretwalters12,
In order to achieve this, you will be required to use a formula to build your FileName.
You will want to start with something along the lines of:
"C:\Users\(Your Username)\Desktop\"
Then you would want to specify the filename of your .xslx file. This is where you input these date formulas to pull in the month and year. I use padleft() for the month section just in case you want 0's to be in front of months which are single digit.
Month: padleft(tostring(DateTimeMonth(DateTimeNow())), 2, '0')
Year: tostring(DateTimeYear(DateTimeNow()))
Then you want to add in your "WorkingPaper" part followed by the file type and sheet name.
The whole formula should look like this:
"C:\Users\(YOUR USERNAME)\Desktop\"
+ padleft(tostring(DateTimeMonth(DateTimeNow())), 2, '0')
+ tostring(DateTimeYear(DateTimeNow()))
+ "WorkingPaper"
+ ".xlsx|||"
+ "Sheet1"
In the output tool, tick the box "Take File/ Table Name from Field".
Select the Filename field you created and untick the "Keep Field in Output" checkbox.
Let me know if this works for you.
Andrew
Hi @garretwalters12 ,
I've attached a workflow showing you how to do this.
You create the Month-Year as below:
Then configure your output tool to append this to the filename:
Hope this helps.
M.