Hi, I am looking for help with filtering gallery with 2 toggle buttons . I am able to filter with 1 button but not able to add second to filter records for a different column. both the columns are yes/No type in same column
This filter works :
If(Toggle1.Checked,Filter(Mycollection,isRegistered='isRegistered (TableName)'.Yes),If(!Toggle1.Checked,Filter(Mycollection,isRegistered='isRegistered (TableName)'.No),Mycollection))
I want to add another filter to same gallery now using a diff toggle button and diff column but i am getting error when i use && to combine 2 queries.
If(Toggle2.Checked,Filter(Mycollection,isAssigned='isAssigned (TableName)'.Yes),If(!Toggle1.Checked,Filter(Mycollection,isAssigned='isAssigned (TableName)'.No),Mycollection))
Thanks ! Let me test and update you if this works
This does not work as Isassigned columns has Yes and No i want to show that using Toggle1 button (For example when toggle 1 is checked it should show Yes values and when off it should No values) .
I want to do same with Isregistered column ,that coloum also has yes/No . The formula i posted above works for Toggle1 and Isassignec column , i am not able to combine it with Toggle2
Hi @amritat
If you simply want to filter by both Toggle value (whether it is linked to anything or not)
Just Use This One on Items Property of Gallery
Gallery Items : Filter(Mycollection,isAssigned=Toggle1.Value || isRegistered=Toggle2.Value)
With({regfly: Filter(Mycollection,isRegistered='isRegistered (TableName)'.Yes,
regfln:Filter(Mycollection,isRegistered='isRegistered (TableName)'.No,
asnfly:Filter(Mycollection,isAssigned='isAssigned (TableName)'.Yes
asnfln:Filter(Mycollection,isAssigned='isAssigned (TableName)'.No
option1: Toggle.Checked && Toggle2.Checked
option2: !Toggle.Checked && Toggle2.Checked
option3: Toggle.Checked && !Toggle2.Checked
option4:! Toggle.Checked && !Toggle2.Checked
},
If(
option1, regfly && asnfly, //both toggles checked
option2, regfln && asnfly, //toggle1 unchecked toggle2 checked
option3, regfly && asnfln, //toggle1.checked, toggle2 unchecked
option4, MyCollection // both toggles unchecked
)
)