question

ISUTri-7793 avatar image
0 Votes"
ISUTri-7793 asked MayankBargali-MSFT edited

Logic App - Import 1 Attachment from an email with multiple attachments

I am currently receiving an email with 2 attachments. I only want to import one of those attachments and then archive the email. The problem I am facing is I can import the attachment and archive the email but it tries to do that for both attachments. So after the email is archived it tries to read it again.

94102-azurelogicapp-email.png

How can I only execute this once so that only 1 attachment is read and then the entire email is archived? Below is my structure as of today. I did have a condition where i looked at the attachment's name that i wanted. But that still didn't work.

Any thoughts?

azure-logic-apps
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MayankBargali-MSFT avatar image
0 Votes"
MayankBargali-MSFT answered MayankBargali-MSFT edited

Hi @ISUTri-7793

Welcome to Microsoft Q&A! Thanks for posting the question.

As per the screenshot of the workflow, I can see that you have trigger for "When a new email arrives in a shared mailbox" then you are checking all attachments and creating the blob with the current attachment. But I don't see any condition that checks the attachment name inside the for each loop as you have mentioned that you are checking the condition.

You need to write the condition inside the "for each" action to check if the current attachment matches with your name of the attachment that you want to save. If true then only execute the "Create Blob" action.

For the second issue, on your "When a new email arrives in a shared mailbox" make sure you are specifying the Folder name field for which you want logic app to get triggered. If you are removing this field then for every email in any of the folders the logic app will gets triggered.

The screenshot is for another action but the shared mailbox also has the Parameter "Folder" that you can define.

94233-image.png

Hope the above helps you. Feel free to get back to me if you need any assitance.


image.png (14.5 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.