web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

Triggered a Power Automate Flow when a subgrid is added to or deleted from

(0) ShareShare
ReportReport
Posted on by 515

Hi

I've a subgrid on a form for a model driven up.

I need to be able to trigger that flow whenever that subgrid is added to or deleted from

The relationship is N:N

Does anyone have any tips?

Thanks
Lee

I have the same question (0)
  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    Check this post - crmtipoftheday.com/.../

  • SashM Profile Picture
    10 on at

    You can do something like this.

    Create a new field that tracks the number of records added to the sub grid.

    For example: no_of_records

    Create and add below function onload of the form with function name "Sdk.formOnLoad"

    Run the workflow or power automate when "no_of_record" field is updated.

    var Sdk = window.Sdk || {};

    (function () {

    this.formOnLoad = function ()

    {

    debugger;

    var gridContext = Xrm.Page.getControl("your_subgrid_name_here"); // sub grid name

    gridContext.addOnLoad(Sdk.gridOnLoad);

    }

    this.gridOnLoad = function()

    {

    debugger;

    var gridContext = Xrm.Page.getControl("your_subgrid_name_here");

    var grid = gridContext.getGrid();

    var totalNumberOfRecord = grid.getTotalRecordCount();//no of record

    var rows = grid.getRows();

    if(totalNumberOfRecord == 0)

    {

    setTimeout(Sdk.gridOnLoad, 3000);

    }

    if ( totalNumberOfRecord != null){

    Xrm.Page.getAttribute("no_of_records").setValue(totalNumberOfRecord);

    }else{

    Xrm.Page.getAttribute("no_of_records").setValue(0);

    }

    }

    }).call(Sdk);

  • SivaR Profile Picture
    71 on at
    You can use flow and webhook to achieve this. 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
11manish Profile Picture

11manish 172

#2
ManoVerse Profile Picture

ManoVerse 58 Super User 2026 Season 1

#3
Niki Patel Profile Picture

Niki Patel 42

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans