cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
luisabsg
Helper V
Helper V

Filter Gallery using radiobutton with condition

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. 

luisabsg_0-1629458109515.png

 

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")

 

4 REPLIES 4
KBilakanti1
Microsoft
Microsoft

@luisabsg ,

 

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"
    )
)

KBilakanti1_0-1629459645656.png

 

What is "ColItems" ? Is my SPList?

this code will show me the items in blank too? 

@luisabsg 

 

"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 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,461)