cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kran
Helper IV
Helper IV

How to filter datasource based on parent?

I want to create a gallery called "Products", which should be filtered based on its parent account "Packages" - which is a 1-N relation.

 

The guid of the particular Package will be given as an input from a global variable.

 

How to create this type of filter? If it was the other way around (N-1 relation) it would be easier.

 

Kran_0-1637879244851.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-jefferni
Community Support
Community Support

Hi @Kran ,

 

As you mentioned there is 1:N relationship between the Package table and the Product table, there should be a LookUp column in the Product table which look up from the Package table. Therefore, I assume the Package LookUp column in the Product table is with column name of "PackageLookUp", you could try below formula for the Items of the Gallery.:

Filter(Products, PackageLookUp.PackageGUIDColumn = varGUID)

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

4 REPLIES 4
AmDev
Super User
Super User

Hi @Kran 

 

Just want to clarify that these assumptions are correct

 

There are two separate data sets, one called 'Products' and one called 'Packages'?

There are many products to 1 package?

The package GUID is in a column in the 'Products' data set to relate them to the associated package?

 

Based on this, you want your Gallery to only show the products that have the same GUID as that passed in by the variable?

 

If this is the case, your Formula should be:

 

Filter(Products, varGUID = YourProductGUIDColumnName) 

 

Hope my understanding is correct, but please let me know if not and provide further clarity to allow me or another community member to help you further.

 

Thanks and Good Luck!

Kran
Helper IV
Helper IV

Thanks for your reply @AmDev 

Your understanding is quite correct, but only thing is that I want to filter something like this:

Filter(Products, varGUID = PackageGUIDColumnName)

 

But my Products table does not have a column for package guid.

AmDev
Super User
Super User

Hi @Kran 

 

What type of data source are you using?

 

Do you have any link / relationship between the Packages table and the Products Table?

v-jefferni
Community Support
Community Support

Hi @Kran ,

 

As you mentioned there is 1:N relationship between the Package table and the Product table, there should be a LookUp column in the Product table which look up from the Package table. Therefore, I assume the Package LookUp column in the Product table is with column name of "PackageLookUp", you could try below formula for the Items of the Gallery.:

Filter(Products, PackageLookUp.PackageGUIDColumn = varGUID)

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

Helpful resources

Announcements
Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Users online (2,280)