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.
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:
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 Itemsproperty of the second Galleryto following:
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.