Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

Update parent row with a message if there are no related rows in the subgrid

(0) ShareShare
ReportReport
Posted on by

Hi, has anyone used power automate, cloud flows to check the number of rows in a subgrid, so check there are a number of child rows, and if there is less than one, the put a message on the parent row to say 'You need to add a ... (related row)'

If I get the 'list of rows' using power automate and a get the number of those rows with the expression: length(outputs('List_rows')?['body/value']), how could I then put a message, like a warning on the parent row? 

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Update parent row with a message if there are no related rows in the subgrid

    Hi dsammied,

    If you don't want to write js code, you can refer following link to download Alerts4Dynamics app:

    Alerts-Notifications Dynamics 365-Alerts4Dynamics (microsoft.com)

  • dsammied Profile Picture
    dsammied on at
    RE: Update parent row with a message if there are no related rows in the subgrid

    Thank you, using the notifications needs to be easier! rather than writing JS and web resource - I'm not an expert at JS and find writing a web resource takes quite a long time for me.

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Update parent row with a message if there are no related rows in the subgrid

    Hi dsammied,

    You can create a new text field in parent entity, then use 'Update a row' action to update the field with the message.

    https://docs.microsoft.com/en-us/power-automate/dataverse/update 

    But it's impossible to achieve it through power automate if you want to show alert message in the form, just like following screenshot:

    pastedimage1634098629478v1.png

    You need use setFormNotification() function in js code:

    setFormNotification (Client API reference) in model-driven apps - Power Apps | Microsoft Docs

    Count related records through is:

    Count Total Subgrid Records in Dynamics CRM using JavaScript – Passion Dynamics (passion4dynamics.com)

    Or you can create a rollup field to count related reords:

    Count the number of related child records using a Rollup field – Passion Dynamics (passion4dynamics.com)

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

Announcing Our 2025 Season 1 Super Users!

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

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,399 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans