cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
zmansuri
Super User
Super User

Filter blank value based on checkbox

q14.png

When Contract checkbox is checked all the values which have blank values under contract field should disappear from gallery same for Training and Skill. Any ideas?

2 ACCEPTED SOLUTIONS

Accepted Solutions
Abhilash_Swain
Super User
Super User

Hi @zmansuri 

"On Check " for contract check Box, add UpdateContext({Chkcontract:!Chkcontract})

"Items" in Gallery ,  If (ChkContract, Filter(Gallery source, !IsBlank(Contract),gallery Source).

 

Please let me know if you get the error due to syntax, I will try in a sample table and share

View solution in original post

Nogueira1306
Super User
Super User

Hey.

You should filter it.

 

So, in Items property you should wirte something like this:

If(CheckboxContract.Value = true; Filter(List; Contract != ""); List)

So, if the checkbox is selected, it will filter the list and retrieve the contacts that have something. If not, it will retrieve the whole list

View solution in original post

5 REPLIES 5
Abhilash_Swain
Super User
Super User

Hi @zmansuri 

"On Check " for contract check Box, add UpdateContext({Chkcontract:!Chkcontract})

"Items" in Gallery ,  If (ChkContract, Filter(Gallery source, !IsBlank(Contract),gallery Source).

 

Please let me know if you get the error due to syntax, I will try in a sample table and share

Nogueira1306
Super User
Super User

Hey.

You should filter it.

 

So, in Items property you should wirte something like this:

If(CheckboxContract.Value = true; Filter(List; Contract != ""); List)

So, if the checkbox is selected, it will filter the list and retrieve the contacts that have something. If not, it will retrieve the whole list

zmansuri
Super User
Super User

I did it with this code.

 

If(
    chkTraining.Value = true && chkSkill.Value = true,
    Filter(
        Zishan,
        !IsBlank(StatusForTraining) && !IsBlank(StatusForSkill)
    ),
    If(
        chkTraining.Value = true && chkSkill.Value = false,
        Filter(
            Zishan,
            !IsBlank(StatusForTraining)
        ),
        If(
            chkSkill.Value = true && chkTraining.Value = false,
            Filter(
                Zishan,
                !IsBlank(StatusForSkill)
            ),
            Zishan
        )
    )
)

Is there a better way?

I think not.. That is almost the solution that I was telling you about...

Will it work if you filter the gallery without blank values and show all items when a user wants to see them.

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.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

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 (6,588)