Posts

Showing posts with the label Power Automate

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...

How and when to use Base64 expression in Microsoft flow.

Image
I have created a flow that gets trigger on update of an "account" entity record and creates a Note(Annotation) record in Dataverse, This note has a PDF attachment. Flow is like this, in the last step, I am creating a note in Dataverse and attaching a newly created PDF in it: But, I am getting the below error while attaching pdf in a note: Invalid character in field 'documentbody': '', hexadecimal value 0x04, is an invalid character. The reason behind it is the "Document" column, Flow accepts a file content in "Base64", hence I have to change it to base64: Below are steps to convert it in "Base64": Step 1: Click on the Document text box as highlighted below then click on "Expression". Step 2: Search for "Base64" and put bracket(). Step 3: Click on "Dynamic Content", keep the cursor in between the bracket() and click on "File Content" Step 4: Click ok. Now, the Document Text box has the follo...

What is Microsoft Power Platform

Image
In simple words, Microsoft Power platform is a place where we can work on the following technologies: PowerApps  Power Automate Power BI  Power Virtual Agents   We can create the following type of components in PowerApps: Model-Driven App : Default app for Microsoft Dataverse or Dynamics 365. We can not connect with other system databases except Microsoft Dataverse. Canvas App : It provides the facility to connect with multiple system databases including Microsoft Dataverse. There are multiple prebuilt connectors available that help us to connect with multiple systems. Power Portal : It is a website for users who do not have an office365 license, Here users can interact with Microsoft Dataverse data. Here we can create flows and do operations in Microsoft Dataverse as well as in other systems. There are multiple prebuilt connectors available that help us to connect a flow with multiple databases. For eg, A task record should be created in Dynamics 365 if we get a tweet on...