3
votes

Hi I am working in Azure Logic app. I am trying to get multiple files from azure data Lake gen v2 and attach these multiple files in an email. As a first step I have added http request and I am giving required information along with file path. It works fine for one file. but I am trying to input folder path and inside that folder, all the files I want to get and attach in email.

Logic app Flow Diagram

Added sample screenshot for attachment

tried to add attchment

In the above diagram, Get blob content step which works fine for one file but I am finding difficult to attach multiple files in email. Can some one help me to figure out the solution. Any help would be appreciated. Thank you

1
Hi John. No I already went through that question. That will send multiple emails but i want to add multiple files in same emailNiranjan Godbole Hosmar

1 Answers

2
votes

You can use List blobs action to list all blobs in the folder you want:

enter image description here

Then you can define a variable to append the attachments array.

enter image description here

Use For Each to loop the blobs from List Blobs action. Within For Each you can use Get blob content to get blob content, and then use Append to array variable to append attachments.

The expressions of Path, DisplayName and File Content are as follows:

Path : items('For_each')?['Path']

DisplayName : items('For_each')?['DisplayName']

File Content : body('Get_blob_content')

enter image description here

enter image description here

Finally, please fill in the attachment in the email:

enter image description here

==========================update===================

If you send an email with 400 response, please use expression in Append to array variable as below:

base64(body('Get_blob_content'))

enter image description here