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
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

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

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Users online (3,031)