cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jerry5209
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
abm
Super User III
Super User III

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 blogPower Automate Video Tutorials

View solution in original post

3 REPLIES 3
abm
Super User III
Super User III

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 blogPower Automate Video Tutorials

View solution in original post

v-bacao-msft
Community Support
Community Support

 

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.

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
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (58,704)