Blog

Update related records in Dynamics 365 through Flow

When working with Dynamics 365 you’ve probably come across the requirement to update related records based on a field of the parent record. Some business examples I’ve encountered are:

Copy the address from an account to its contacts.

Copy the primary contact on the account to its opportunities.

…

There’s tons of examples out there. I even blogged about a No-Code solution in Dynamics CRM back in 2017. For this mini-tutorial I will be using Flow to copy the website field from an account to its contacts.

Now we’re not really interested in retrieving any information from the contact, so we can just put the contactid in the Select Query. The Filter Query is where we define which contacts should be retrieved, by definining the link with the account and adding a filter on status. Note that we’ve added the dynamic Account field from the previous step.

Add another step. This time, choose Update a record.

Select Contacts as Entity Name. In the Item ID field, enter the Contact field that is found under the List Records step. Doing so will automatically create a correct For-loop.

Scroll down to the Website field. Select it and fill it with the Website field that you find in the Dynamic content pane.

That’s it! You’re all set. Don’t forget to fill in a name for the Flow and save it.

Behold the end result

After creating this Flow, we simply go to Dynamics 365 Sales and update the website field on one of our accounts. After that, check out the contacts linked to the account and you should see the website url propagated. Of course this was a fixed example, but based on the above, you should be able to write any Flow to update related records.

In a follow-up post I will describe how to clear lookup fields using Flow, as the update mentioned below will not work for that particular scenario.

Let's thrive together

Thrives is not just our company name. It’s our goal for everyone involved in the process of delivering the best possible solution and experience from employees to customers. By leveraging the best in people, the Dynamics 365 Customer Engagement and Power Platform.