Forum Discussion
How to send an email with a csv attachment
- 8 months ago
Hi dyordanov,
If I were you, I would do the following.
If you created the files using Notebook, they are initially stored in the storage account. Then, in the pipeline (after Notebook), create a lookup activity that lists the files. Transfer this to a variable, which in turn transfers it to a web activity that controls the Logic APP.I hope that was reasonably clear 🙂
Here an simple Guide.
1. Lookup Activity
- Source: your Blob Storage container.
- Configuration:- First row only = false (so that all files are listed).
- Query or path filter: e.g., only files with a specific prefix or extension (.xlsx).
- Result: JSON array with all files found.2. Set Variable Activity
- Transfers the list from the Lookup Activity to a pipeline variable (e.g., fileList).
- Optional: You can transform the list (e.g., extract names only).3. Web Activity
-Target: your Logic App HTTP Trigger.
- Method: POST.I haven't tested this in this configuration yet, but I use something similar at our place.
Best regards
Feel free to leave kudos or accept it as a solution. This will also help other community members.
- 8 months ago
I understand :),
another option is to switch to Event Grid in the Logic APP. I've done that before, too.
You simply replace the trigger that triggers the action with When a resource event occurs (Azure Event Grid). I think that's what it should be called.The advantage is that you only get one event instead of multiple events.
Here is the procedure.
Go to the Storage Account and click Events.
1. Create and configure the event grid accordingly. Important: the event type is Microsoft.Storage.BlobCreated.
2. Change Logic APP.
- Remove the old trigger “When a blob is added or modified”.
- Add a new trigger:
- When a resource event occurs (Azure Event Grid) -
Configure:Subscription: your Azure subscription.
Resource Type: Storage Account.
Event Type: Microsoft.Storage.BlobCreated.I hope that helps.
Best regards
Hi guys,
So finally i managed to do it by creating azure data lake storage and copied the data from the notebook to the storage. Then after I could see the 3 files i need for each country I created a logic app where I use a trigger "When a blob is added or modified" and then I have 3 branches where each then blob catches each file and then outlook should send each file for each counry. However I get 3 countries X 3 emails = total of 9 emails... so how can I get each country to have only 1 file and not 3. Any suggestions ?
- spaceman1278 months agoSuper User
Hi dyordanov,
If I were you, I would do the following.
If you created the files using Notebook, they are initially stored in the storage account. Then, in the pipeline (after Notebook), create a lookup activity that lists the files. Transfer this to a variable, which in turn transfers it to a web activity that controls the Logic APP.I hope that was reasonably clear 🙂
Here an simple Guide.
1. Lookup Activity
- Source: your Blob Storage container.
- Configuration:- First row only = false (so that all files are listed).
- Query or path filter: e.g., only files with a specific prefix or extension (.xlsx).
- Result: JSON array with all files found.2. Set Variable Activity
- Transfers the list from the Lookup Activity to a pipeline variable (e.g., fileList).
- Optional: You can transform the list (e.g., extract names only).3. Web Activity
-Target: your Logic App HTTP Trigger.
- Method: POST.I haven't tested this in this configuration yet, but I use something similar at our place.
Best regards
Feel free to leave kudos or accept it as a solution. This will also help other community members.
- dyordanov8 months agoRegular Visitor
Thanks for the answer but since I have it so far isn't there a simpler solution to fix what I have rather than make everything more complicated ? Otherwise thanks for the answer.
- spaceman1278 months agoSuper User
I understand :),
another option is to switch to Event Grid in the Logic APP. I've done that before, too.
You simply replace the trigger that triggers the action with When a resource event occurs (Azure Event Grid). I think that's what it should be called.The advantage is that you only get one event instead of multiple events.
Here is the procedure.
Go to the Storage Account and click Events.
1. Create and configure the event grid accordingly. Important: the event type is Microsoft.Storage.BlobCreated.
2. Change Logic APP.
- Remove the old trigger “When a blob is added or modified”.
- Add a new trigger:
- When a resource event occurs (Azure Event Grid) -
Configure:Subscription: your Azure subscription.
Resource Type: Storage Account.
Event Type: Microsoft.Storage.BlobCreated.I hope that helps.
Best regards