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

Filtering gallery using buttons on top of SP List

Hello everyone,

I have seen multiple similar threads, but still was not able to resolve it with them.

PowerAppsFilter.JPG

My goal is to retain current formula, which allows me to sort by the upper icon (descend, ascend) by the date and also it searches by the title. Now I need to add a possibility of additional filtering by those buttons on top where one says "Approved", other "Pending", and the last one says "All".

 

I have tried to follow for example this https://powerusers.microsoft.com/t5/Building-Power-Apps-Formerly/Filter-gallery-using-buttons/m-p/40... thread, but I can not even place into the button Set(columnName, "value") as it seems it does not find the variable (column).

 

I have tried to get additional filter via helping out with Label value (button sets the hidden label text and formula works with it), but I did not figure out how to make it display "All".

 

I will appreciate any help in this matter 🙂

 

Thanks.

 

EDIT: The Status value is a multichoice field, I believe I could overcome this changing it to single line of text.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Helper I
Helper I

Re: Filtering gallery using buttons on top of SP List

Alright, I have changed the choice column to single text, added a label "PomocnyLabel pro filtrovani" and then changed the formula to this.

 

SortByColumns(Filter([@Vydaje]; StartsWith(Nadpis; TextSearchBox1.Text) And StartsWith(Stav;'PomocnýLabel pro filtrování'.Text)); "Kdy"; If(SortDescending1; Descending; Ascending))

 

On the buttons I have used Set(Var1;"Approved") and then the labeltext is just equal to Var1.

Seems to be working ok like this 🙂

View solution in original post

3 REPLIES 3
Highlighted
Helper I
Helper I

Re: Filtering gallery using buttons on top of SP List

Alright, I have changed the choice column to single text, added a label "PomocnyLabel pro filtrovani" and then changed the formula to this.

 

SortByColumns(Filter([@Vydaje]; StartsWith(Nadpis; TextSearchBox1.Text) And StartsWith(Stav;'PomocnýLabel pro filtrování'.Text)); "Kdy"; If(SortDescending1; Descending; Ascending))

 

On the buttons I have used Set(Var1;"Approved") and then the labeltext is just equal to Var1.

Seems to be working ok like this 🙂

View solution in original post

Highlighted
Community Support
Community Support

Re: Filtering gallery using buttons on top of SP List

Hi @Kyza ,

Based on the issue that you mentioned, I think you have some misunderstanding with the Set(..) formula I mentioned within the thread you provided.

 

The first argument of the Set() function is required to provide a variable name (maybe you need to specify a different name from these column names from your data source) rather than ColumnName from your data source.

 

I have made a test on my side, please consider take a try with the following workaround:

Set the OnSelect property of the "Approved" button to following:

Set(StatusVar, "Approved") // On your side, you may need to type Set(StatusVar, "Schvaleno")

Set the OnSelect property of the "Pending" button to following:

 

Set(StatusVar, "Pending") // On your side, you may need to type Set(StatusVar, "Ceka na vyrizeni")

 

Set the OnSelect property of the "All" button to following:

Set(StatusVar, "All") // On your side, you may need to type Set(StatusVar, "Vse")

 

Then please set the Items property of your Gallery to following:

SortByColumns(
              Filter(
                      [@Vydaje];
                      StartsWith(Title; TextSearchBox1.Text);
                      If(
                          IsBlank(StatusVar) || StatusValue = "All";
                          true;
                          StatusVar= "Approved";               // I assume that you use a Choice type column called "Status" to store the status value, e,g, Approved, Pending, and All
                          Status.Value = "Approved";
                          StatusVar= "Pending";
                          Status.Value = "Pending"
                      )
              );
              "Kdy";
              If(SortDescending1; Descending; Ascending)
)

 

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Helper I
Helper I

Re: Filtering gallery using buttons on top of SP List

Hello and thanks for your reply.

 

I have managed to get it working via hidden label.text as I mentioned, but I might use your way in my next project.

Thanks 🙂

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,831)