Power Automate, Attempting to add an action that will paste in and rename an export file according to the previous business day in the MM.DD format

38 views Asked by At

Currently running into an issue where I need to include an action in the automation script that will paste in a variable in the section to rename a file to include the previous business day in the MM.DD format:

Ultimately, I have the flow set up such that the file is open, and is in the process of saving it out into a specified file directory. The only thing holding me up in the naming convention.

I've attempted to create a variable that includes a function similar to say formatDateTime(addDays(utcNow(),-1, 'MM.dd')) but this does not seem to have an effect.

More specifically, I need the flow to work with a Tax lots export file. I would need the file renamed "Tax Lots MM.DD" with the MM.DD being the previous business day.

1

There are 1 answers

0
Sam Nseir On

You don't need formatDateTime, and without specifying a <format> to this, it will return it in ISO format.

Try just:

addDays(utcNow(), -1, 'MM.dd')

And if you need it:

concat( 'Tax Lots ', addDays(utcNow(), -1, 'MM.dd') )