Forum Discussion
Concat "Todays Date" for File Name - Save Attachment - Help
I have the same requirement. I tried to add the attachments filename+Received Time. But now it seems that the flow shreds the file and the file is no longer a PDF file that can be opened it is an unknown filetype with a filename that did not reflect the expected filename as configured in the create file section in my flow:
Hi ARadtke
Don't forget to add .pdf to the back of the filename if you haven't already done so.
Cheers
Damien
- Justin_GanglMar 26, 2021Copper Contributor
Hi Damien_Rosario ,
I'm having the same issue with my attachment filename. I have 2 files with the same name coming into a mailbox as attachments, one is a .pdf and the other is a .xlsx. I want to remove the files from the email, and save them to a SharePoint library with today's date/time added to the filename.
Current attachment filenames:
attachmentname.pdf
attachmentname.xlsx
Desired attachment filenames in SPOL:
attachmentname_03-26-2021-2-10-PM.pdf
attachmentname_03-26-2021-2-10-PM.xlsx
In my Create File action, in the File Name field, I've tried using 'Attachments Name'_'Received Time' dynamic content dialogue.
That appends the date after the file extension, attachmentname.pdf_03-26-2021-2-10-PM, giving an unknown filetype.
If I add .pdf in the File Name,
then I get a usable filename, attachmentname.pdf_03-26-2021-2-10-PM.pdf, but it obviously changes my xlsx file to a pdf extension as well.
Any thoughts on how to accomplish this? Appreciate any help you can provide.
- RobElliottMar 27, 2021Silver Contributor
Justin_Gangl you can do this if you split the attachment name on the .dot. You need several Compose controls as shown below:
Rob
Los Gallardos
Microsoft Power Automate Community Super User.
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.- Justin_GanglMar 29, 2021Copper ContributorRobElliott
Perfect! This solves my issue. Thanks so much!
- Damien_RosarioMar 28, 2021Silver Contributor
Hi Justin_Gangl
Rob's solution covers a solution pretty well in the order you want to see it in.
Alternatively, you could put the received date at the front of the name followed by the file name. This way the extension will always work and will require no additional actions.
Cheers and best wishes
Damien
- Justin_GanglMar 29, 2021Copper Contributor