In Winter'23 release Salesforce has given us one more great and useful update which is now we can directly update the related records of a primary record that triggered the flow.

In this blog post we are going to learn about this new feature and how we can take benifit of it.
Use Case : Whenever an Account will be CREATED or UPDATED, update all its related contacts.

So, before this new feature release if we would get this usecase. What would we do?
We would create a RECORD-TRIGGERED FLOW on Account and we would have taken a GET RECORD ELEMENT in which we will get all the contacts.
After that we would takeASSIGNMENT ELEMENT to assign new values to contacts and then UPDATE RECORD ELEMENT to update the contacts with the new values.

Goshh! That's a time consuming task.
In this new feature we have an option in the UPDATE RECORD ELEMENT.
Let's learn about it now.

So, for this use case we are creating a Record-Triggered Flow.

For start condition in Object we have added "Account" and for when this will trigger we have selected "A record is created or updated".

After that we will not take any Get Record Element instead we will use our new option. For that we will take UPDATE RECORD ELEMENT.

Here you can see a new option in the "How to find records to update and set their values" which is "Update records related to the account record that triggered the flow".
So with this option we can directly update related records of account.

After that you will see another option which is "Records Related to Account". In this you will add $Record>Contacts because we want to update the contacts of this Account.
Have a look how you will choose $Record>Contacts :

Now, we will update the contacts "Updated__c" field to True.

That's it. You have update the related contacts for the account that triggered the flow.
That's how easy it is now with the new feature in Update Record Element.

Hope you found this useful.
If you want to see the detailed video tutorial the check out this video :

If you have any question please leave a comment below.

If you would like to add something to this post please leave a comment below.
Share this blog with your friends if you find it helpful somehow !

Let's learn and grow together.
Love and Peace! 

Post a Comment