cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

How to save different email attachments in different folders

Hi, I use a flow that auto save email attachments in sharepoint and it work well.

And now I would like to save different attachments in different folders.

a. the email was a daily report

b. files were all excels

c. files name were "WoYield_xxxxxxxx.xlsx" and "WoDetail_xxxxxxxx.xlsx", the "xxxxxxxx"was yyyymmdd (it changed every day)

 

How to save "WoYield_xxxxxxxx.xlsx" in A foleder and save "WoDetail_xxxxxxxx.xlsx" in B folder when the daily report arrived?

I would like to keep the file name when saved in the folders.

 

Thank you very much.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

Re: How to save different email attachments in different folders

Hi @Jerry5209 

 

Using split and first expression you can get the filename. Once the filename is extracted then add an if condition to check the filename. Use the SharePoint create file step to upload the email attachment.

 

Here is an example of split and first expression to get the filename.

 

Add a compose statement and copy the below expression. Replace the hardcoded filename to email attachment filename.

 

first(split('WoYield_xxxxxxxx.xlsx', '_'))
 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

 

Thanks

 

 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

View solution in original post

3 REPLIES 3
Highlighted
Super User III
Super User III

Re: How to save different email attachments in different folders

Hi @Jerry5209 

 

Using split and first expression you can get the filename. Once the filename is extracted then add an if condition to check the filename. Use the SharePoint create file step to upload the email attachment.

 

Here is an example of split and first expression to get the filename.

 

Add a compose statement and copy the below expression. Replace the hardcoded filename to email attachment filename.

 

first(split('WoYield_xxxxxxxx.xlsx', '_'))
 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

 

Thanks

 

 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

View solution in original post

Highlighted
Community Support
Community Support

Re: How to save different email attachments in different folders

 

Hi @Jerry5209 ,

 

You can use Condition to determine if Attachment Name begins with the specified string value and then save the file to the specified folder.

 

For different folders, you could add a parallel branch to save the file to folder A or B respectively.

Image reference:

150.PNG

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Regular Visitor

Re: How to save different email attachments in different folders

Hi Barry:

 

I tried Abm's solution and it works so I didn't try this solution, I think this one should be worked too, thank you very much.

 

Image 2.jpg

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (11,374)