Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Answered

copy Data from subgrid to field powerapps model driven

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi All,

i'm trying to concatinate Name attribute from a column in a SubGrid to one field.

I added a JS code to the subgrid to get the id and the name, but i don't know how can i put them in other field in the form.

function RunOnSelected(executionContext) {

var selected = executionContext.getFormContext().data.entity;
var Id = selected.getId();
var Name = selected.attributes.getByName("cr5a2_name").getValue();

}

any idea please?

  • Verified answer
    Nya Profile Picture
    Nya 29,058 on at
    RE: copy Data from subgrid to field powerapps model driven

    Hi,

    Yes.

    For example, I created a field called Row ID in Account entity, whose data type is Single Line of Text.

     pastedimage1625560632634v1.png

    Then replace the second step of the flow in my answer above with the update of this field with the GUID of the contact.

     pastedimage1625560637677v2.png

    The value can be saved into the Row ID field.

     pastedimage1625560641503v3.png

    If this helped you, I'd appreciate it if you'd mark this as a Verified Answer, which may in turn help others as well.

    Best Regards,

    Nya

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: copy Data from subgrid to field powerapps model driven

    Thank you for your reply,

    what can I put in the "Row ID" when i update the other table?

    Best Regards,

  • Suggested answer
    Nya Profile Picture
    Nya 29,058 on at
    RE: copy Data from subgrid to field powerapps model driven

    Hi,

    It cannot be achieved by JS only, for no data can be passed between the JS which is applied to sub-grid and the JS to the form.

    You can try to achieve your request with a Flow.

    For example, here is a flow to update the primary contact of an account when selecting the contact from the sub-gird.

     4667.pastedimage1625548325086v1.png

    And then select the contact in the sub-grid and run the flow just created.

     7026.pastedimage1625548343868v3.png

    2275.pastedimage1625548331956v2.png

    6177.pastedimage1625548355863v4.png

    The primary contact field will be updated with the value of the selected contact.

     5238.pastedimage1625548360411v5.png

    If this helped you, I'd appreciate it if you'd mark this as a Verified Answer, which may in turn help others as well.

    Best Regards,

    Nya

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…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,966 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans