Hey, I need to filter my gallery using a radio.
My DB is a SPList and I'm using a column "Concluir" of the type "Choices" to filter.
When the radio is "Não concluido", only items "Não", is appears and when the radio is "Concluído", only items "Sim" appears.
But, I want that when the items is "Não" and in blank too appears when the radio button "Não concluído" is selected.
My filter:
Sort(Filter('Fórum DV FP';Concluir.Value=TipoStatus);'Agendamento do Forum')
Radio OnChange:
If(Radio1.Selected.Value="Não Concluido";Set(TipoStatus;"Não";Set(TipoStatus;"Sim")
You can use the below approach:
Demo Collection:
ClearCollect(ColItems,{Concluir:"Não"},{Concluir:"Sim"},{Concluir:"Não"});
Logic:
Switch(
Radio1.Selected.Value,
"Não concluido",
Filter(
ColItems,
Concluir = "Não"
),
"Concluído",
Filter(
ColItems,
Concluir = "Sim"
)
)
What is "ColItems" ? Is my SPList?
this code will show me the items in blank too?
"ColItems" is temporary collection which I used, rather than creating SharePoint list. If you want to filter Blanks then you can add !IsBlank() function something like below.
Switch(
Radio1.Selected.Value,
"Não concluido",
Filter(
ColItems,
Concluir = "Não" And !IsBlank(Concluir)
),
"Concluído",
Filter(
ColItems,
Concluir = "Sim" And !IsBlank(Concluir)
)
)
Doesn't work 😞
I change ColItems to my SPList because when I use ColItems, the gallery turn in blank. The gallery doesn't filter