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

SP List Items Filter Based On Status Button

Hi, 

I Have add some buttons to filter the SP List items based on selection of status buttons.

Can some help me how to to filter with logic 

 

Gallery Name 'CMM Inspection Request Form'

 

Kindly see the pic enclosed pic for more information.

 

Thanks 

Sunil

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User III
Super User III

@sunilkumar 

Yes, I would be happy to help here.

 

The All Request button needs this code in the OnSelect property

Set(showAll, true);


Each button should have code like this in the OnSelect property.

Set(showStatus, "New"); Set(showAll, false);
Set(showStatus, "In-progress")​; Set(showAll, false);

 

Set(showStatus, "On Hold"); Set(showAll, false);
Set(showStatus, "Completed"); Set(showAll, false);

 

The final step depends on whether your Status column is a 'single line text' type or a 'Choices' type in SharePoint.

 

If Status is a single line text type put this code in the Items property of your gallery.

Filter(your_datasource_name, Status = showStatus Or showAll = true)

 

If Status is a choices type put this code in the Items property of your gallery.

Filter(your_datasource_name, Status.Value = showStatus Or showAll = true)

 

Now the buttons can be pressed to filter the gallery.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

 

 

 

 

View solution in original post

5 REPLIES 5
Super User III
Super User III

The simplest way in my view is to replace the buttons with a one combobox1.
On the items of the combobox1 put: Distinct(Datasource,StatusColumn)

 

Then on the Gallery items put: Filter(Datasource,StatusColumn=combobox1.Selected.Result)

 

With this, when completed is selected, only completed would be seen.

 

 

 

Super User III
Super User III

@sunilkumar 

Yes, I would be happy to help here.

 

The All Request button needs this code in the OnSelect property

Set(showAll, true);


Each button should have code like this in the OnSelect property.

Set(showStatus, "New"); Set(showAll, false);
Set(showStatus, "In-progress")​; Set(showAll, false);

 

Set(showStatus, "On Hold"); Set(showAll, false);
Set(showStatus, "Completed"); Set(showAll, false);

 

The final step depends on whether your Status column is a 'single line text' type or a 'Choices' type in SharePoint.

 

If Status is a single line text type put this code in the Items property of your gallery.

Filter(your_datasource_name, Status = showStatus Or showAll = true)

 

If Status is a choices type put this code in the Items property of your gallery.

Filter(your_datasource_name, Status.Value = showStatus Or showAll = true)

 

Now the buttons can be pressed to filter the gallery.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

 

 

 

 

View solution in original post

Thanks a lot, it;s works perfect...

@mdevaney 

 

Once quick question, 

 

after applying all the formula, in gallery it;s not showing all time until we click All buttons. but still it;s calculating the total number of line items. Can you please suggest me how to enable all items must visible on gallery when we open the apps. based on that list it should filter when click the respective button.

 

Along with existing status filter i need to add text search based on  part number. to search the part number i was using (Filter('CMM Inspection Request Form',StartsWith(Part_x0020_Number,TextInput_PartNumber.Text), 

 

Status filter Gallary code is  - Filter('CMM Inspection Request Form', Status.Value = showStatus Or showAll = true)

 

can you suggest me how to combine both filters for same gallery , 

 

Thanks

Sunil

 

 

s,

Sunil

@sunilkumar
Suggest you post this as a new question.

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (4,511)