cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
BenzPA
Level: Powered On

Filter gallery by related entity records (Many to many relationship)

Hi !

I have 2 entities with many to many relationship based on CDS :

- Entity 1: "Drinks"

- Entity 2 : Flavours  

A drink have multiple flavors (ex : Apple, Lemon, Orange) also, a flavour can be in multiple drinks.

when I navigate to my screen, I passed a context variable "Apple" and on my screen I have a gallery of drinks, I would like to filter this gallery to show only drinks that contains "Apple" flavour (without delegation issue because I have more than 2K records).

Is there a way to do that within filtering ? Or it is better to create a collection filtered on the app start ?

 

In advance, Thank you so much for your support !

 

1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft v-siky-msft
Microsoft

Re: Filter gallery by related entity records (Many to many relationship)

Hi @BenzPA ,

 

Try to put the following formulas to Items property of drinks gallery:

 

If(IsBlank(Var_Apple),Drinks,LookUp(Flavours,'Field Name'= Var_Apple).Drinks)

 

Best regards,

Sik

If my post is helpful for you, please click on “Accept as Solution” to help other members find it more quickly.

View solution in original post

2 REPLIES 2
Microsoft v-siky-msft
Microsoft

Re: Filter gallery by related entity records (Many to many relationship)

Hi @BenzPA ,

 

Try to put the following formulas to Items property of drinks gallery:

 

If(IsBlank(Var_Apple),Drinks,LookUp(Flavours,'Field Name'= Var_Apple).Drinks)

 

Best regards,

Sik

If my post is helpful for you, please click on “Accept as Solution” to help other members find it more quickly.

View solution in original post

BenzPA
Level: Powered On

Re: Filter gallery by related entity records (Many to many relationship)

Hi @v-siky-msft 

Thank you four your prompt reply, It works on PowerApps designer when I Play the application but when I publish the application the gallery is empty ..

 

 

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Users online (4,936)