cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted

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
Highlighted
Super User III
Super User III

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.
Highlighted

Hi mdevaney,

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

 

thanks

Highlighted

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

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

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 

Highlighted

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

Highlighted

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

Highlighted

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

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

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (14,000)