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

Show records in gallery that have no child records

Hi,

I have a CDS data source with two entities and a 1:M relationship for the parent and the child entity (with lookup field to parent entity in the child entity).

In my canvas app, I created a gallery where I want to show all records from the parent entity that do not have a child record yet. I managed to show the number of child records in the gallery, but now want to filter the gallery for items where this number is 0. Could you please provide some guidance how to do this?

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions

Sorry for first question, the info was inside your topic .... I just miss it ! 🙂

The most elegant way is to define in CDS  a filtered view on parent entity. This way you move the computing process on server side.

In filter condition choose related entity. The condition is: the related entity does not contain data. I put the process in a small .gif.

Inside the powerapps app you can refer to this view using:

Filter(ParentEntity, NameOfTheView)

View solution in original post

5 REPLIES 5
gabibalaban
Super User
Super User

What type of data sources you use ? Sharepoint, Sql ... ?

MZ2
Frequent Visitor

I use CDS

Sorry for first question, the info was inside your topic .... I just miss it ! 🙂

The most elegant way is to define in CDS  a filtered view on parent entity. This way you move the computing process on server side.

In filter condition choose related entity. The condition is: the related entity does not contain data. I put the process in a small .gif.

Inside the powerapps app you can refer to this view using:

Filter(ParentEntity, NameOfTheView)

View solution in original post

MZ2
Frequent Visitor

Thanks so much! To be fair I edited the topic, because I forgot to say which data source I use 😉

m_jeppesen
Helper I
Helper I

Sorry for bringing up an old post.

I have the same scenario, just the other way around.

 

I want to show parent records in a drop down, but only if that parent record have child records.

Is there some way of doing this with a query inside PowerApps, without the use of CDS/Dataverse views? - since I keep running into an issue in CDS/Dataverse, where doing the query works in Dynamics, but when using the view in PowerApps, the view returns the same 'parent' record x-amount of time, depending on how many child records are in the system.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,547)