Power Automate Dataverse Upload a File or an Image

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.

Example:

  • There is a Dataverse table called IT Issue Resolutions. This table has the fields below with different data types. Such as:
  1. Sender = This is the Dataverse Primary column with a single line of text data type.
  2. Issues = Single line of text data type
  3. Report Date = Date Data type
  4. Status = Choice Column having some choices like Approved, Rejected, Pending, etc.
  5. Attachments = This is a File column. To know more details about the Dataverse file column, read: How to Create Dataverse File Field
Power Automate Dataverse Upload a File or an Image
Power Automate Dataverse Upload a File or an Image
  • 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.

Dataverse Upload a File or an Image Power Automate
Dataverse Upload a File or an Image Power Automate

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.
Dataverse Upload a File Power Automate
Dataverse Upload a File Power Automate

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.
How to upload a file or an image in Dataverse using Power Automate
How to upload a file or an image in Dataverse using Power Automate

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.
Upload a file or an image in Dataverse using Flow
Upload a file or an image in Dataverse using Flow

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.
Upload a file or an image in Dataverse using Power Automate
Upload a file or an image in Dataverse using Power Automate
  • 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.
Upload a file in Dataverse using Power Automate
Upload a file in Dataverse using Power Automate
  • 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.
Upload a file in Dataverse Power Automate
Upload a file in Dataverse Power Automate

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.
Power Automate Upload a file in Dataverse
Power Automate Upload a file in Dataverse
  • 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:
contains(crf9a_sender, 'From')

Where,

  1. crf9a_sender is the logical name of the Sender (Dataverse column).
  2. From, you can take this under the When a new email arrives (V3) action from the Dynamic content.
Upload file in Dataverse using Power Automate
Upload file in Dataverse using Power Automate

Check out: Microsoft Flow Error “Could not find a property named ‘crf9a_Sender’ on type ‘Microsoft.Dynamics.CRM.crf9a_itissueresolutions’”

See also  Power bi measure switch statement with examples

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.
Power Automate Upload file in Dataverse table
Power Automate Upload file in Dataverse table
  • 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.
Power Automate upload a file or image in Dataverse
Power Automate upload a file or image in Dataverse
  • 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.

Power Automate Dataverse upload a file
Power Automate Dataverse upload a file

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.
Power Automate Dataverse upload an image
Power Automate Dataverse upload an image
  • 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.
Dataverse upload a file using Power Automate
Dataverse upload a file using Power Automate

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.
Upload a file in Datavesre using Power Automate
Upload a file in Datavesre using Power Automate

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.
How to Upload a file in Datavesre using Power Automate
How to Upload a file in Datavesre using Power Automate

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.
How to upload file in Dataverse using flow
How to upload file in Dataverse using flow

This is how to Upload a File or an Image in Dataverse using Power Automate.

See also  How to use Power Apps date picker

Furthermore, you may like some more Dataverse and Power Apps tutorials:

In this Dataverse tutorial, we discussed how to work with Power Automate Dataverse Upload a File or an Image.

>