
Announcements
Hi all,
I have a link that looks like this - https:// ... (year)...(month).xslm.
The month part of the link changes every month. Is there any way for Power Automate to save a file from this URL to SharePoint?
Thank you for your help!
You can get the current time and then make two separate variables. One variable for year, and then another variable for month.
Within each variable you use the expression formatDateTime() to extract the Year 'yyyy' from the current time and the month will use 'MM' to extract the month.
Create a third variable that will hold the URL string and type out what the url will be. Where the year and month go within the URL string, put the variables.
I made an example. In my example my Excel file is in the Documents folder, and the name of my excel file will be "My Excel Document-202306" where the last part 202306 is the year and month yyyyMM of the current time.
Create Variables
Example Flow Results
The example flow above is an easy to follow example. I like it because it is clear to see what is happening and easier to make changes.
It is possible to have it all done in a single step within the string by using the utcNow() expression which is basically the same as the Current Time action.
So if I wanted my file name to be "Excel File-2023-06-23" which corresponds to the year-month-day I could have a single string that is: Excel File-utcNow('yyyy')-utcNow('MM')-utcNow('dd')
Expression Within Name
Let me know if this works for you