Send Records from Microsoft Dynamics 365 through email using Azure Logic Apps.
In this blog we will copy a list of Account names that exists on our Microsoft Dynamics 365 system and send all these names via email using Azure logic Apps.
- To start the map select a HTTP request trigger, which would run on demand at the click of the run trigger button.
![](https://www.cloudfronts.com/wp-content/uploads/2021/11/image-6.png)
- After defining the trigger and an action to list rows from Dynamics 365 and select the entity needed from the drop down. In this case I have selected Accounts. You can also add filters using parameters to limit the data extracted.
![](https://www.cloudfronts.com/wp-content/uploads/2021/11/image-7.png)
- Initialize a variable in order to store the data, since there are more than one records the data type of the variable should be an array
![](https://www.cloudfronts.com/wp-content/uploads/2021/11/image-8.png)
- Now for each record (value) found in Dynamics 365 we have to add it to the array, therefore we use a For each loop and append new data to array inside the for loop
![](https://www.cloudfronts.com/wp-content/uploads/2021/11/image-10.png)
- Next we will use a Send Email block and add the variable which we used to store account names. After this we can run the flow
![](https://www.cloudfronts.com/wp-content/uploads/2021/11/image-11-1024x569.png)
- On running the map an email containing all account names in our Dynamics 365 system gets received.
![](https://www.cloudfronts.com/wp-content/uploads/2021/11/image-12-1024x554.png)
Hope this blog helped!!