Ravi Anand
Ravi Anand

Reputation: 5544

How to iterate email attachments after Get Emails action in Azure Logic App?

I created logic app and added following steps:

  1. Recurrence trigger for every next min.
  2. Get Emails action (include attachments: true).
  3. Now have to iterate each email
  4. while iterating email have to iterate all attachments under current email.

but I am not able to do so.

Upvotes: 0

Views: 1517

Answers (1)

Derek Li
Derek Li

Reputation: 3111

First, instead of using a recurrence trigger, then get email action, consider using "When an email arrives" trigger instead. If all you care is new ones coming in that contains attachments. You will notice it has a "SplitOn" property, so it gets all the new emails in bulk, them spin off new instance for each email for subsequent processing. From there on, you can use For-each to iterate thru all attachments.

If you want to maintain the logic apps as designed, you will need to use for-each to iterate thru each email, and call a child logic app to iterate thru all attachments within each email. This is because the limitation of no nested for-each support - we're currently working on this feature and soon you will be able to create nested for-each.

Upvotes: 1

Related Questions