cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Station1901
Level: Powered On

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
Community Support Team
Community Support Team

Re: Filter Gallery using Toggle results

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

Re: Filter Gallery using Toggle results

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.
Station1901
Level: Powered On

Re: Filter Gallery using Toggle results

Hi mdevaney,

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

 

thanks

Super User
Super User

Re: Filter Gallery using Toggle results

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

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

Re: Filter Gallery using Toggle results

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 

Station1901
Level: Powered On

Re: Filter Gallery using Toggle results

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

Community Support Team
Community Support Team

Re: Filter Gallery using Toggle results

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

Station1901
Level: Powered On

Re: Filter Gallery using Toggle results

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
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,954)