cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MatMd
Frequent Visitor

Showing fields from "grandparent" table in model-driven power app view

I am building a model-driven power app and I regularly have a situation where:

- "Child" table has an N->1 relationship to "Parent" table

- "Parent" table has an N->1 relationship to "Grandparent" table

- When I'm looking at a view of records in the Child table I really need to be able to show the "grandparent" name.

 

Power Apps seems to allow me to show column values from directly related tables, but not indirectly related tables.  Is there any solution / workaround to this?

 

If not, is this a feature that could be added?

1 ACCEPTED SOLUTION

Accepted Solutions
SBax
Impactful Individual
Impactful Individual

This is not possible unfortunately.

 

I have achieve something like this in the past, but it took a fair bit of work, and it relied on having the same set of fields in all three records (grandparent, parent, child) and a mechanism to update the fields when a change is made

 

Option 1 - Field Mapping - this option only works if you are creating parent/child from a subgrid

  • Set up field mapping to pass the fields from the grandparent to the parent (assuming this is created from a subgrid within grandparent, and repeat the same for passing from parent to child)
  • Limitations - if the field values update in a higher record, they are not updated in the lower one automatically

 

Option 2: Javascript - only works if records are created only from the UI (i.e. not by some other means, like a Flow)

  • Write a script to run on save of a child record to get the grandparent record (via the parent record), and write the fields to fields with the same name in the child record.
  • Limitations: field values in the child record will only update when the record is saved. If the app is heavily used, with lots of saving of child records, this could consume a lot of API calls.

 

Option 3 - Flow

  • Write a flow that runs on create on a child, finding the parent, then the grandparent, and write to a set of fields on the childs record
  • Write a second flow that when a grandparent record is updated, list parents related to the grandparent, and write data to the relevent fields on parent, then list children of the parent, and write to those fields (you could skip writing to the parent, and just write to the children if you prefer)
  • limitations - again, could use a lot of API calls in an app that is heavily used

 

Happy to discuss either of the above options in more detail if these seem suitable

View solution in original post

3 REPLIES 3
SBax
Impactful Individual
Impactful Individual

This is not possible unfortunately.

 

I have achieve something like this in the past, but it took a fair bit of work, and it relied on having the same set of fields in all three records (grandparent, parent, child) and a mechanism to update the fields when a change is made

 

Option 1 - Field Mapping - this option only works if you are creating parent/child from a subgrid

  • Set up field mapping to pass the fields from the grandparent to the parent (assuming this is created from a subgrid within grandparent, and repeat the same for passing from parent to child)
  • Limitations - if the field values update in a higher record, they are not updated in the lower one automatically

 

Option 2: Javascript - only works if records are created only from the UI (i.e. not by some other means, like a Flow)

  • Write a script to run on save of a child record to get the grandparent record (via the parent record), and write the fields to fields with the same name in the child record.
  • Limitations: field values in the child record will only update when the record is saved. If the app is heavily used, with lots of saving of child records, this could consume a lot of API calls.

 

Option 3 - Flow

  • Write a flow that runs on create on a child, finding the parent, then the grandparent, and write to a set of fields on the childs record
  • Write a second flow that when a grandparent record is updated, list parents related to the grandparent, and write data to the relevent fields on parent, then list children of the parent, and write to those fields (you could skip writing to the parent, and just write to the children if you prefer)
  • limitations - again, could use a lot of API calls in an app that is heavily used

 

Happy to discuss either of the above options in more detail if these seem suitable

MatMd
Frequent Visitor

Thanks -- I feared that this might be the case.

Could you help regarding the third solution, !! 

Is there a tutorial or video explaining this way !!

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,981)