0
votes

Logic App 1 - I have an Azure Logic app For Each loop that loops through languages and outputs a Caption.vtt file for each language in a folder on OneDrive. For example, if the user choose :English, Spanish, French. The For Each loop will iterate 3 times and output three vtt files on the "Transcript VTT file" OneDrive folder.

Logic App 2 - After languages are outputted on the OneDrive folder, I created an action to check for any new files in that OneDrive folder. If there are any new files, I want to send those (vtt files) as an attachment to my user by e-mail.

The problem I am having is that, the Logic app is sending three separate emails to the user for each language . I was expecting the Logic app to send only ONE email to the user with three files as an attachments. I think the problem is that my "Create File" action is inside my For Each loop, which is why it is sending 3 separate emails. But I am not sure how to moigy it, so that it sends only one email with three VTT file attachments.

How to modify my Logic app so that it sends only one email to the user with all the VTT files as attachment?

Here re the workflow of my Logic APPS:

1st - Logic app enter image description here enter image description here enter image description here

Logic APP 2:

enter image description here

1

1 Answers

0
votes

You can do it in the main logic app itself. Here are the steps to follow 1) AT start of your logic app, initialize an array variable. 2) Inside for each loop, when the file is uploaded to the one drive, you can then add the file name to the array. 3) Once all the files are uploaded, and you exit the for loop, send the email

PS: you will have to consider what your logic needs to be in case of failure. If the flow fails after indexing two files and uploading them what do you want to do.

The logic you have for second logic app will always trigger a separate email.