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 II
Super User II

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
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,501)