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

Filter Gallery with Combobox and Toggle


This should be simple but I am struggling.

I am loading a Gallery from a SQL table CustSite and the filter on selecting a Province is working.

I now want to select either Account Customers (CustId starts with "D") or Cash Customer(CustId starts with "C")


The code on the Gallery Items:


Filter('[dbo].[PA_Customers]',Province=cmbProv.Selected.Value,If(Toggle1.Value = false,StartsWith(CustId,"C"),StartsWith(CustId,"D")))


No data is Showing.

Please help.

Super User
Super User

Re: Filter Gallery with Combobox and Toggle



Try to change that formula for your Gallery Items property to this:

Province=cmbProv.Selected.Value && StartsWith(CustId,If(Toggle1.Value, "D","C"))

See if you have any luck with that.  If not, try to remove the && StartsWith... portion of the filter and see if you are even getting any results with just the ComboBox value.

Community Support Team
Community Support Team

Re: Filter Gallery with Combobox and Toggle

HI @SoftSpot ,

Based on the formula that you provided, I do not find any syntax error with it.


Please consider take a try to modify your formula as below:

   Toggle1.Value = false,
   Filter('[dbo].[PA_Customers]',Province=cmbProv.Selected.Value, StartsWith(CustId,"C")),
Filter('[dbo].[PA_Customers]',Province=cmbProv.Selected.Value, StartsWith(CustId,"D")) )

In addition, please also make sure that the result the Filter('[dbo].[PA_Customers]',Province=cmbProv.Selected.Value) formula returns contains records whose CustId column value starts with "D" or "C".


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.

Re: Filter Gallery with Combobox and Toggle

Thanks for posting in the community @SoftSpot - can you review the above replies and update the thread if they were helpful? 


Thank you,