Do you know how to upload a file or an image in a Dataverse row using Power Automate? No worries! In this Dataverse tutorial, we will see how to work with Power Automate Dataverse Upload a File or an Image.
In a recent assignment, I had to use Power Automate to upload a file to a certain Dataverse row. And we’ll put it into practice through this tutorial to see how it functions.
Also, Read: Power Automate Dataverse Add New Row
Power Automate Dataverse Upload a File or an Image
Here, we will take one scenario and explore how to upload a file or an image into a Dataverse row using Power Automate.
- There is a Dataverse table called IT Issue Resolutions. This table has the fields below with different data types. Such as:
- Sender = This is the Dataverse Primary column with a single line of text data type.
- Issues = Single line of text data type
- Report Date = Date Data type
- Status = Choice Column having some choices like Approved, Rejected, Pending, etc.
- Attachments = This is a File column. To know more details about the Dataverse file column, read: How to Create Dataverse File Field
- I want to create a flow right now where the sender sends an email with an attachment (file). The relevant file will attach in the specific dataverse row if the sender email contains the given Dataverse sender name.
- For instance, if Sonam sends an email with an attachment ([email protected]), then the sender’s name will be filtered.
- If the email address is the same as the Dataverse sender name, then the specific file will upload in Sonam’s attachment field as shown below if the requirement is met.
Refer to the screenshot below.
To achieve this above requirement, follow the steps below.
Step – 1: [Create a new automated flow]
- Open Power Automate and Sign in with your valid Microsoft credentials.
- Go to My flows (from the left navigation) -> Expand + New flow -> Select Automated cloud flow under the Build your own from blank section.
Step – 2: [Provide Flow name and Choose the trigger]
- The window shown below will then display, asking you to enter the flow name and select the flow trigger.
- Flow name = I have given the flow name as Extract Names from Email.
- Choose your flow’s trigger = Search or select the trigger from the list below to create a flow. In my case, it’s When a new email arrives (V3).
- Click on Create.
Step – 3: [Select Include Attachments]
- Once the flow has been created, the trigger will appear as shown in the screenshot below. Expand the trigger and select Yes under the Include Attachments field.
Step – 4: [Add Get Attachment]
- Click on the + icon and Add an action to insert a new step below the trigger (When a new email arrives (V3)).
- Search Get attachment in the search bar -> Select Office 365 Outlook -> Click on Get Attachment (V2) under the Actions tab.
- Expand the Get Attachment action and enter the below field values as:
- Message Id = Select the field and click on the Message Id under When a new email arrives (V3) from the Dynamic content. When you will select the Message Id, then the Apply to each action and its value (Attachments) will add automatically.
- The below screenshot represents the Attachment Id.
- Attachment Id = Select the field and click on the Attachments Attachment Id under When a new email arrives (V3) from the Dynamic content.
Step – 5: [Insert List rows action]
- Then, under the Get Attachment (V2) action, click on the + icon and add a Microsoft Dataverse List rows [PREMIUM] action.
- Once the List rows action has been added, just select the Dataverse Table name (IT Issue Resolutions) from the dropdown menu.
- In the Filter rows field, apply the code below:
- crf9a_sender is the logical name of the Sender (Dataverse column).
- From, you can take this under the When a new email arrives (V3) action from the Dynamic content.
Step – 6: [Upload a file or an image action]
- To upload a file of the specific sender, Click on the + icon and add an action called Upload a file or an image [PREMIUM] action under Microsoft Dataverse.
- Expand the action and fill in the field details below:
- Table name = Provide the Dataverse table name (IT Issue Resolutions) from the dropdown menu.
- Row ID = Select the field and click on the IT Issue Resolutions under the List rows action [from Dynamic content].
- Column name = Select the Dataverse File column name (Attachments) from the dropdown.
- Also, the below fields are there:
- Content = Select the field and click on the Content Bytes under the Get Attachment (V2) action [from Dynamic content].
- Content name = Select the field and click on the Attachments Name under the Get Attachment (V2) action [from Dynamic content].
Refer to the screenshot below.
Step – 7: [Save and Test the flow]
- Finally, Save the flow. Click the flow checker as well to see if there are any problems.
- If so, fix it. If not, move on to testing the flow. Select Test.
- Select Manually and click Test as shown below in the Test Flow pane. You must send a new email to your inbox to check whether the flow is functional or not.
- For this, I used Sonam, a different account, to send a message (with an attachment) to my inbox, as shown in the screenshot below.
Step – 8: [Flow ran successfully]
- At the top of the flow, a statement such as “Your flow ran successfully” will appear when the flow eventually completes successfully.
Step – 9: [Refresh the Dataverse table]
- Return to the relevant Dataverse table (IT Issue Resolutions) at this point and perform a single refresh. The image below shows the email attachment that has been added to Sonam’s Attachments space.
Step – 10: [Save the File]
- If you want to save the Dataverse file in your local system, then select the record and click on the Edit row using Form from the top bar.
- In the Dataverse form, click on the file link -> Choose a location to save the Dataverse file -> Click on Save as shown below.
This is how to Upload a File or an Image in Dataverse using Power Automate.
Furthermore, you may like some more Dataverse and Power Apps tutorials:
- Power Automate Get Display Name From Email
- Power Automate Dataverse Update Multiple Rows
- How to Patch Dataverse Number Field in Power Apps
- Dataverse Power BI [Complete tutorial]
- Power Apps Print Function [With Various Examples]
In this Dataverse tutorial, we discussed how to work with Power Automate Dataverse Upload a File or an Image.
After working for more than 15 years in Microsoft technologies like SharePoint, Office 365, and Power Platform (Power Apps, Power Automate, and Power BI), I thought will share my SharePoint expertise knowledge with the world. Our audiences are from the United States, Canada, the United Kingdom, Australia, New Zealand, etc. For my expertise knowledge and SharePoint tutorials, Microsoft has been awarded a Microsoft SharePoint MVP (9 times). I have also worked in companies like HP, TCS, KPIT, etc.