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

Filter Gallery using Toggle results

Hello,

I have a sharepoint list which holds data collected from a powerapp.  One of the columns in the sharepoint list is named 'Assessment' and the results in this column are patched in from a toggle switch.

I am trying to generate a gallery on another screen which only filters records from that list which are true but I can get it to work.  The 'true' results show in the sharepoint list as Yes though I have altered my formula to test this and nothing works.  I am relatively new to designing powerapps so it could be something simple but i'm really stuck.

My sharepoint list is named 'DriverLeavers' and the column I am trying to pull in and filter is names 'Assessment' I have tried using....

'Filter(DriverLeavers,Assessment="Yes")'

'Filter(DriverLeavers,Assessment=true)'

Both of these just display every record held in the sharepoint list in the gallery

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Station1901 ,

Could you tell me the data type of Assessment?

If it is a yes/no data type, then please refer what he said @Drrickryp 

It is a known issue that you can not use ""true/false" to filter a yes/no data type in sharepoint list.

For now, I suggest you use 1/0 to filter this kind field.

Using "1" to filter items are true.

Using "0" to filter items are false.

For example: 

Filter(DriverLeavers,Assessment=0)    //false items

Filter(DriverLeavers,Assessment=1)   //true items

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
mdevaney
Super User
Super User

To diagnose your issue I must ask a preliminary question: did you check to see if the PATCH was successful?

Now that we are sure the data was successfully patched did you refresh your datasource after the patch? Try this:

Filter(DriverLeavers,Assessment=True);
Refresh(DriverLeavers);

Note: there is an upper case T in True.

Let me know if this works for you or if it fails.

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

Hi mdevaney,

Thanks for getting back to me. The patch is fine but unfortunately it didn't work with 'True' or lowercase 't'

 

thanks

@Station1901
Did you use the Refresh statement after PATCH as I have suggested in my previous post?

Filter(DriverLeavers,Assessment=True);
Refresh(DriverLeavers);

Hi @Station1901 

There is a well known bug related to SharePoint True/False columns.  If you change it to single line of text, it works as you wish. Alternatively, there are work arounds using collections. https://powerusers.microsoft.com/t5/Building-Power-Apps-Formerly/Filter-will-not-filtering-properly-...  @Shanescows recent video on ForAll() and Patch() shows this workaround as well. https://www.youtube.com/watch?v=0xZ4fMJbLvk 

Yes, I've used the refresh statement.  Also, The patch is in a separate part of the app (different screen & activated with a button).  I assumed my gallery would work from the existing data in the sharepoint list 'DriverLeavers'? - It's still not working

Hi @Station1901 ,

Could you tell me the data type of Assessment?

If it is a yes/no data type, then please refer what he said @Drrickryp 

It is a known issue that you can not use ""true/false" to filter a yes/no data type in sharepoint list.

For now, I suggest you use 1/0 to filter this kind field.

Using "1" to filter items are true.

Using "0" to filter items are false.

For example: 

Filter(DriverLeavers,Assessment=0)    //false items

Filter(DriverLeavers,Assessment=1)   //true items

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

The data type is Yes/No.  I have used the 1/0 as you have suggested and my gallery now works perfectly.  Thankyou!!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,607)