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

Multiple entities / relationships / CDS query

Hi Everybody.

 

Can someone please point me to a guide/template example (or document how it can be done, e.g what to put in the source/item properties) to create the following please using CDS custom data sources and PowerApps.

 

I can't find a guide that uses 2 tables with a relationship example

 

Scenario

Data stored in CDS

 

Custom Entity 1 (Partners) -> Primary_ID       ->   Primary Key

Custom Entity 2 (Contacts) -> Relationship (lookup) created using CDS interface to Partners entity, Partners_Primary_ID   (1 : N)

 

e.g a Partner can have multiple contacts

 

Screen 1

Gallery control uses Partners Entity - User selects a partner record, on_select moves to Screen 2

 

Screen 2

Entity Form (experimental) needs to display N related entries of Selected Partner

 

Also would like to know how to do this with Display/Edit Form too when multiple records will be returned of course with the 1:N relationship please

 

p.s is there a way to script CDS entity/field creation

 

Thanks in advance

 

Loving Powerapps by the way !!!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Frequent Visitor

I am going to add this on. I was attempting to do something similar and the below article helped me. You can use the look up selected fields in the first gallery to filter the items in the second gallery.

https://powerapps.microsoft.com/en-us/blog/one-to-many-relationships-for-canvas-apps/

 

For the purposes of this explanation, let's assume the first galler is named Partners and the second gallery is named Contacts. For the Contacts gallery, try setting the Items to Partners.Selected.<Contacts field> where <Contacts field> is the filed you want to display from the Contacts entity

 

I hope that helps.

View solution in original post

7 REPLIES 7
Highlighted
Community Support
Community Support

Hi rcotgrov,

 

I assume this documentation could be a reference for you:
https://powerapps.microsoft.com/en-us/tutorials/working-with-forms/

 

Please check it and if you need more help, please feel free reply.

 

So far, I haven’t seen a way to create Entity/Field using Script. Maybe you could create an idea at PowerApps Ideas Forum, PGs will check this forum and take it into consideration in future releases:
https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

 

Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Frequent Visitor

Thanks. The example is with a single entity I think? I'm looking for the way to do this with 2 related entities where I am using a foreign key to obtain data from the other entity.
Highlighted
Frequent Visitor

 
Highlighted
Anonymous
Not applicable

Did you ever get this working?  I am trying to do the same thing...

Highlighted
Power Apps
Power Apps

Hi rcotgrov,

 

Did the documentation provided help with this issue? Please let me know if there is something we can do to help here.

Thanks,
Clay.
Highlighted
Frequent Visitor

I am going to add this on. I was attempting to do something similar and the below article helped me. You can use the look up selected fields in the first gallery to filter the items in the second gallery.

https://powerapps.microsoft.com/en-us/blog/one-to-many-relationships-for-canvas-apps/

 

For the purposes of this explanation, let's assume the first galler is named Partners and the second gallery is named Contacts. For the Contacts gallery, try setting the Items to Partners.Selected.<Contacts field> where <Contacts field> is the filed you want to display from the Contacts entity

 

I hope that helps.

View solution in original post

Highlighted
Anonymous
Not applicable

Thanks so much for sharing your solution @JacksonP!

 

@Anonymous

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (11,233)