cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Veronika_Kys123
Helper I
Helper I

Display gallery based on selected item on homepage

Hello! 

 

I haven't found a similar question - please help me! 

 

I want to display only records from a selected country - I have my filter (for the View all), but I want for the users to be able to select a country on a homepage and based on the country they selected -  show only records from selected country.

 

Ex.: I will select Spain in the homepage, it will show records from Spain.

 

Thanks in advance for your help, I am desperate! 😶

2 ACCEPTED SOLUTIONS

Accepted Solutions
jcfDaniel
Super User
Super User

Hi,

 

Try this. On the Country button, on the OnSelect property: Set(varCounty, Self.Text); Navigate(YouOtherScreen)

 

In the Gallery, in the Itemns Property: Filter ( YourTable, Country = varCountry )


Regards. JD.

View solution in original post

uwenagel
Resolver II
Resolver II

Can you check the content of your global variable 'varCountry'. Is it a record or a text value? In the first case you should use Country.value = varCountry.Value.

 

Looking to your formula it seems to me that you already have your selected country in the filter conditions. So the additional Country=varCountry may not be necessary. You could completely omit that.

 

Btw: Isn't there a comma missing after Country=varCountry?

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item.

If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

15 REPLIES 15
jcfDaniel
Super User
Super User

Hi,

 

Try this. On the Country button, on the OnSelect property: Set(varCounty, Self.Text); Navigate(YouOtherScreen)

 

In the Gallery, in the Itemns Property: Filter ( YourTable, Country = varCountry )


Regards. JD.

Thanks ! Do I need to set the variables OnStart in the App? 

jcfDaniel
Super User
Super User

No, you just need to put the formula in the Button's OnSelect.


Regards. JD.

Unfortunatelly its not working 😞 

 

Maybe because I have the "Country" as a choice question in my sharepoint list? 

 

uwenagel
Resolver II
Resolver II

Can you check the content of your global variable 'varCountry'. Is it a record or a text value? In the first case you should use Country.value = varCountry.Value.

 

Looking to your formula it seems to me that you already have your selected country in the filter conditions. So the additional Country=varCountry may not be necessary. You could completely omit that.

 

Btw: Isn't there a comma missing after Country=varCountry?

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item.

If the content was useful in other ways, please consider giving it Thumbs Up.

jcfDaniel
Super User
Super User

ok,

 

First, insert a label and set it to varCountry, just to make sure you have your country value as text.

 

Next, check to see if your choice allows for multiple choices.


Regards. JD.

Thanks! Setting the Country.Value=Country, worked...however now non of me other filters are working... 😞 

 

So its working like - i select country on homepage and it filters records only from that selected country. However I cannot use my other filters

 

uwenagel
Resolver II
Resolver II

Where do you set your other filters? How do you conclude your other filters are not working?

Ah... nevermind, I just deleted whole command box and it started working !!! It just needed a little push I think. 🙂 

 

But one more thing - any chance that I can also choose another country in the filter after I choose my "selected" on the homepage?

Ex. I choose Spain on the homepage but after I wanna add also "Czechia" in my filter and display both. 

(Tried to show attached)

Helpful resources

Announcements
Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

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

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

<
Users online (4,705)