Update Dynamics 365 Data using Flow

Introduction
In our earlier article we discussed how we can create data in Dynamics 365 CE using Microsoft Flow from excel file. Now in this article we are going to discuss how we can update existing data using flow.

Requirement: In our earlier example we used following excel table to upload data to contact entity,

upload1

Now let’s say we have updated some data and added some new records, now we want to update existing data based on the email id of contact and if it’s not available we want to create it (like upsert operation)

 uploadupdate3

Solution:
Follow our earlier article and implement step 1-4 to achieve following:
uploadupdate4
Now lets add a List Records action from Dynamics 365 and configure it like following, here we are going to query Dynamics 365 contacts based on the email id from excel file.
uploadupdate5
Now lets add a condition to check if list of records not empty, first add condition and set value like following
uploadupdate7
After that click on Edit in advance mode and change it like below, here we are checking if the above list record action returned null value.
uploadupdate6
Now after check above condition we need to add Create step under Yes section and Update section under No section like following
uploadupdate9and need to configure update like following

uploadupdate8

We can set other fields using expression items(‘Apply_to_each’)[‘ColumnNameFromExcelFile’] . Finally add delete step to delete the excel file from one drive.

upload7

Now save your changes and upload file to one drive after couple of mints we will be able to see contact data like following
uploadupdate10
If contact exists with email id it will update contact otherwise it will create new contact record.

Stay tuned for more Dynamics 365 Contents !!

One thought on “Update Dynamics 365 Data using Flow

  1. Pingback: Update Dynamics 365 Data using Flow - Microsoft Dynamics CRM Community

Leave a Reply