Posts

Showing posts with the label Dataverse

How to avoid "for each" in Power Automate when there is only one record in Dataverse List rows

Image
There are some situations when we retrieve only a single row. To retrieve an entity record from Dataverse we generally use "List Rows" feature and this always returns an entity collection. Hence we always need to go in "for each" loop. As shown in the below example, I am creating an email on the creation of an account entity record in Dataverse. I have retrieved a queue to set it in "from" activity party of the email. I know that there is only one queue record but I am helpless if I directly select "Dynamic content", It automatically creates a "for each" loop. See in below screenshots: If I go for expression rather than "Dynamic content" then I can avoid "for each" loop, Please refer below screenshot: Below line, I have written in expression: outputs('List_rows_Queue')?['body/value'][0].queueid Here "List_rows_Queue" is the above step, [0] is the first row and "queueid" is a field ...

Power Automate: Create an Excel file during runtime and send it as email attachment through MS Flows

Image
I was working on a requirement where Dataverse entity record needs to be export in excel and send as an email attachment. In this scenario, each record must have a separate excel file, and as we know there is no way to create an excel file dynamically through flow. To achieve the above task, I have followed below steps: Step 1:  I created an excel template in one drive and this template has one table and two columns i.e. Name and City: We can increase/decrease columns as per requirement. In this example, my template name is "Sample sheet.xlsx" Step 2: Create a Microsoft flow that triggers on the creation of "Contact" in Dataverse: Then add a new step to get the file template from one drive that was created in Step 1: Next, Add a new step to copy the template with a new name at a new location on onedrive: I have created a new folder with the name "Copies" in onedrive before creating the above step. The next step is to compose rows, In step 1, I have created...