Showing results for 
Search instead for 
Did you mean: 
Helper II
Helper II

Collections with Related Entities

Hi All,


I have a canvas app where I do a ClearCollect() on Accounts from my CDS.  But I then try and use a related entity (Appointments) in a gallery by setting the Items to mainGallery.Selected.Appointments as I have done when using a Data Source directly. It doesn't error, but there's no data for the Appointments.  Is there something I need to do for the collection to get the related data too?  Or is it just the case that it doesn't bring that data on a Collect?


If it's the case that by design we don't get related entity data, I can't figure out a way to filter my Appointments by the selected Account.


Anyone have any ideas?





Super User III
Super User III

Hi @BigJohn 

You will need to specify exactly the records that you are referencing and since the datasource is different (its now a collection), you will need to use Filter the Foreign key in the appointments gallery by the Primary key in the collection.  Assuming that you have a gallery of accounts with the collection as your Items property.  So the items property of the appointments gallery will be:



Community Support
Community Support

Hi @BigJohn ,

Do you save your Accounts Entity records into a collection, and then use it as data source in your Main Gallery?


Based on the formula you provided, I think there is something wrong with it. There is an known issue that -- when saving CDS Entity reocrds into a Collection, the LookUp field would not be populated with proper values.


As an alternative solution, please consider use your Accounts Enitty as data source in your main Gallery instead of the collection. After that, you could use the following formula to retrieve the related Appointment Records for the selected account:

Set the Items property of the second Gallery to following:


Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

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.


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

Users online (10,961)