web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Complex Flow Issue -> ...
Power Automate
Suggested Answer

Complex Flow Issue -> Save attachments from multiple emails + compare file names in Sharepoint + send email with multiple attachments

(2) ShareShare
ReportReport
Posted on by 4

Hello everyone,

 

Situation and goal is as follows:

 

Emails containing attachments are sent to an email address - there are 2 different emails, each with it's own different attachment for each PO - the names are generic and not helpful.

The goal is to save each attachment to a sharepoint, match the 2 files corresponding to the same PO and then send an email with both files as attachments;

 

Achieved so far: 

- Attachments are being saved for each email to a specified Sharepoint folder

- AI models are used to extract relevant info from documents (i.e. order number and other identifiers)

- New files created in Sharepoint, file name being the order number extracted 

 

Issues encountered:

- I don't seem to be able to loop the flow so that it waits until both files are saved and then move on to the next action - I am guessing I need to create a new flow ? 

- I am unable to find a way to compare file names in Sharepoint and "match" together the files that contain the same value (i.e. 123.pdf and 000123.pdf) 

 

Screenshots from my flow:

 

Norbert_123_0-1688735645890.png

 

Norbert_123_1-1688735669162.pngNorbert_123_2-1688735690083.png

 

The way it works right now, since the 2 documents received in the 2 different emails are also different:

 

It saves the attachment to a sharepoint

Gets file content/metadata

Uses AI model to extract certain info that is found in one of the documents

If that succeeds (meaning the correct AI model was used for the correct file type) - it gets the email address from an excel table corresponding to that extracted info and then creates a file using the extracted data for the file name

If it fails (incorrect AI model used for the file type) - it uses another AI model to extract the info and creates a files using the extracted data for the file name

 

Not sure how to continue from here in order to achieve the main goal which is to send an automatic email to the address previously retrieved from the excel table with both files as attachments. I need to either loop the "on new email" trigger which doesn't seem to be possible, or create a new flow that checks the file names in the Sharepoint library and matches the ones that contain the same value.

 

In the current state, the flow will end after either of the AI models succeeds and 1 file is created, and then run again when another email is received. 

 

Do you have any suggestions?

 

Categories:
I have the same question (0)
  • Dot4 Profile Picture
    2 on at
    Hello,
    I am facing the same problem and wanted to ask if you have already managed to solve it?
    If so, would it be possible for you to upload the detailed steps?
    Regards,
    Dot4
  • Suggested answer
    Sayan Profile Picture
    818 Super User 2025 Season 2 on at
    Hey,
     
    Which AI model are you using to extract the Data. As some of the AI models are support some specific types of Documents
     
     
    As you can see that this Model only support only JPEG, PDF, PNG.
     
    so, please check once the Model.
     
    -----------------------------------------------------------------------------------------------------------------------------------------------------
    If my suggestion helps, please gives it a Like and Marks as a Solution. Which motivates me to solve more problems.
     
    Thanks,
    Sayan Patra, RPA Developer

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard