I have created this post in the event that you may want to guard against duplicate file names being saved in SharePoint or OneDrive when generated from an email.
Let's just say you get a csv file named "report.csv" emailed to you every day. You want to save that file from Outlook, to SharePoint but not overwrite the previous file of the same name.
This makes it tricky to use "Get email" and "Attachments Name" from dynamic data as you would have to rename the file yourself in SharePoint to avoid the file overwrite on the next Flow run.
Full details at the link below.
EDIT: For anyone who may have issues with dots or periods in their file name then please see this post as an add on.
I try to get this Flow working, but I fear that some commands in the Flow have now been renamed. and the action "outputs" there are now 2 of them. you now have the choice between action outputs and trigger outputs. (what should it be?) And what needs to be filled in with the 2nd variable where you say you want to fill it in later?
I have now a error on:
The template validation failed: 'The repetition action(s) 'apply_to_each_Attachment_on_the_email' referenced by 'inputs' in action 'Compose' are not defined in the template.'.
This is what i now have.
The "outputs" (in my example):
You need to put your "Set Variable" and your "Create file" inside the "Yes" branch.
If you mirror this image and the details in the post you shouldn't find issue. If you keep your naming convention the same, you can even copy and paste the expressions I have used. They are all in the blog were required.
Here is the complete Flow (from blog post):
This post and the Flow were created 3 days ago, nothing has been renamed by Flow. Only the use of clicking the elipses (...) and renaming each action as I stepped through the process to make it easier to understand.
It would be best that you delete what is outwith the "Yes" branch and name your "Compose" to "Compose FileExtension" in the way I have just described then continue to follow the blog post. Then recreate the "Set Variable FileExtension" and "Create file" within the "Yes" branch.
Also - triggers are what start the Flow off, there is only ever one of them. In this case "On new email (webhook).
Actions, are what come after the trigger. Everything else is an action.
If you have found my posts helpful, please mark them thumbs up.
If this post has solved your problem, please click "Accept as Solution".
Any other questions, just ask.
Hi @frixel . It looks like your naming convention ...
You have called your "Apply to each" , "Apply to each 2" in the first image.
Assuming you have now renamed it (you haven't included it in the last image so I am guessing at this part), it needs to be exactly the same as mine, including capitalisation.
My "Apply to each" action is called Apply to each Attachment on the email
That allows me to use: "split(items(‘Apply_to_each_Attachment_on_the_email’)[‘Name’], ‘.’)"
Yours would need to match identically, if it doesn't, you will need to change it to suit.
So, if you have named it "Apply to each 2" "split(items(‘Apply_to_each_2’)[‘Name’], ‘.’)"
Fill out a quick form to claim your user group badge now!
We've given our badges an overhaul and also added some brand new ones!
Learn how to build the business apps that you need.
Find out where you can attend!
Watch & learn from the Power Automate Community Video Gallery!