Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Answered

Can you update multiple records in a sub-grid using a workflow?

(0) ShareShare
ReportReport
Posted on by 217

I have a sub-grid of KPIs (custom entity) on my Opportunity entity. When an Opportunity is closed as won, it creates a Contract using a workflow. The Contract also has a sub-grid of KPIs, and I'd like to be able to map the KPIs from the Opportunity to the Contract automatically as part of the workflow. 

In other words, is there a way to do a sort of mass-update of the Contract/KPI lookup field? So that when an Opportunity is closed as won, all the KPIs have their Contract lookup changed to the one that has just been created.

Is there any way to do this using workflows, or would it require some sort of custom coding? I'm not a coder, so really hoping there's a solution I just haven't considered within workflows! 

  • Verified answer
    LuHao Profile Picture
    40,878 on at
    RE: Can you update multiple records in a sub-grid using a workflow?

    Hi Charlotte,

    I would recommend you create an Opportunity lookup field on the Contract entity first, then in the workflow, add the condition that the Opportunity lookup field of Contract contains data.

    The advantage of this is that we can set the trigger of the flow to that the Contract is created and its Opportunity lookup field is not null, so that 1) When the flow is triggered to run, we can guarantee that the Contract has been created, 2) we can Use Opportunity lookup field of Contract to quickly find its corresponding Opportunity without going through list records.

    If there is no such lookup field, then flow can only be triggered when Opportunity is updated and the StateCode is 1. Then since flow has the same trigger as workflow, it is possible that flow will run before workflow, or if workflow fails to run, then flow will be invalid.

    So in order to achieve perfect results, I would recommend you create an Opportunity lookup field on the Contract entity first.

    pastedimage1602742245900v2.png

    Then in the workflow, for the Create record step, use the closed Opportunity to populate the lookup field.

    pastedimage1602742633534v3.png

    Finally set the flow as follow.

    pastedimage1602743454689v4.png

  • Timussch Profile Picture
    on at
    RE: Can you update multiple records in a sub-grid using a workflow?

    Hi Charlotte,

    Does this one help : www.inogic.com/.../

  • thecharwest Profile Picture
    217 on at
    RE: Can you update multiple records in a sub-grid using a workflow?

    Hello Hao - thanks for your reply.

    We do indeed use Power Automate - if you did have some details that'd be amazing!

    Diolch,

    Charlotte

  • LuHao Profile Picture
    40,878 on at
    RE: Can you update multiple records in a sub-grid using a workflow?

    Hi Charlotte,

    We can achieve it through Power Automate.

    The logic is when Opportunity is closed as win, list reocrds for KPIs records related to this Opportunity, and then update their Contract lookup field to the Contract record corresponding to this closed Opportunity.

    Please let me know if you accept Power Automate (flow), and if so, I will provide you with detailed steps screenshots.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,238 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,923 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans