Hello,
I am new to Power automate and am trying to get rid of manual email moving.
I have a good idea but do not seem to get it to work.
I hope one of you experts can help me with this.
I am building a flow that collects email from a shared mailfolder (=cloudflow).
Once the email is collected a few checks are applied.
Stage one is always succesfull.
Emails from certain senders are selected and undergo a rework to flatten the email.
However when criteria 1 is not met I run into trouble.
The idea is that if there is a different sender, then the flow should check the email attachments.
If one of the attachments is an xml file then it should be moved to a folder.
If no XML file is found a next stage is applied which checks for PDF files and so on.
However, each email usually contains multiple attachments. and there is where it goes wrong.
When I use the Apply to each "Value" or "Current item" the flow blocks.
If I use the Apply to Each "Attachments" the flow processes 1 email multiple times (1 time for each attachment found)
And thus applies the subsequent action for as well yes as no and the email ends up in the wrong place.
- I need the flow to check if any of the attachments meets the condition.
- Then apply the subsequent steps to the email (being if yes, move the email ; if no, check for the next condition)
Below an example of the multiplication.
This is the result of 1 email being processed.
The email contained multiple attachments
Here the build of the flow