Is there a way to dynamically name the excel output file depending on the current day? Ideally, I could have the file be named the prior day for each business day.
posted a fix along with a simpler example in a toolbox in your workflow. We are overwriting the entire path now.
Hi @jason_clough14
Yes. You can use a formula tool to add a new column to calculate the prior day.
DateTimeAdd(DateTimeNow(), -1, "days")Then, in the Output Data tool, configure it to change the file name using that new field.
If it's just changing the Sheet name, then you can try to change the entire file path instead. In that case, add the whole file path to the new field created in the formula tool.
Let me know if that helps!
Cheers,
Esther
Yep and it is pretty easy.
1.
Grab a formula tool and put in a forumlua for the prior day:
todate(datetimeadd(DateTimeNow(), -1, 'days'))
make sure to include toDate to strip the hh:mm:ss part.
2.
On your output tool configure the output to use the field as a suffix on the file name. It will make a file for each field value, but in this case they are all the same so there is only one output, with yesterdays date in appended to the name.