web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

Filter Dropdown Value Based On OnCheck Checkbox variable

(0) ShareShare
ReportReport
Posted on by 165

Hi, 

 

I have a situation where I'll need to filter dropdown choices in Form B based on oncheck checkbox in Form A.

NurSabrina24_0-1671785800662.png

I have multiple checkboxes in Form A, where I change dropdown layout to checkbox layout.

NurSabrina24_1-1671785912895.png

And for Update property for the multiple checkboxes datacard is as follows:

 

requisitionfor

 

 

Is there anyone knows how? Please help. If I have missed any of past posts that have the similar one to this, you can share to me as well. 

 

p/s: I have referred to this post: Setting dropdown selected item but it does not get to what I wanted to. 

 

Thank you. 

I have the same question (0)
  • WiZey Profile Picture
    3,023 Moderator on at
    Re: Filter Dropdown Value Based On OnCheck Checkbox variable

    Hello @NurSabrina24 ,

     

    "Checkbox" control return a "Value" boolean property if either the checkbox was checked or not.

     

    You could then add "Filter()" in the "Items" property of your dropdown to filter its items based on the checkboxes.

     

    Filter(
     Choices(...),
     If(Checkbox1.Value,
     //true,
     //false
     )
    )
  • NurSabrina24 Profile Picture
    165 on at
    Re: Filter Dropdown Value Based On OnCheck Checkbox variable

    Hi, could you elaborate more? Maybe with example so I can understand more the solutions you gave to me.

    I have created a collection for oncheck checkboxes which is in the Update property of the checkbox datacard. So instead of using checkboxname.Value, can I use the collection?

     

    Thank you.

  • WiZey Profile Picture
    3,023 Moderator on at
    Re: Filter Dropdown Value Based On OnCheck Checkbox variable

    Of course you can use a collection, if you have a key to retrieve your checkbox without confusion.

     

    If I were to elaborate:

    1. You're populating your dropdown with "Choices()" by default

     

    Choices(
     source.column
    )

     

    2. To filter the items returned from "Choices()", you nest the function in "Filter()"

     

    Filter(
     Choices(...),
     true //This will return all records from the filtered source. Basically no filter applied.
    )

     

    3. But "Filter()" need conditions to select which records can stay and which records must be removed from the selection

     

    Filter(
     Choices(...),
     Value = "value" //Select all records from Choices(...) where the value is equal to "value"
    )

     

    4. You fill in the condition with the checkboxes you check or uncheck

     

    Filter(
     Choices(...),
     checkbox.Value, //If you checkbox is checked, return true
    )
     

     

     

    I'm guessing you've stored your checkbox in a collection with a name to easily recognize them, so you could use "LookUp()" to get the checkbox from the collection like this:

     

     

    LookUp(
     collection,
     key = "value" //return the checkox whose key is equal to "value"
    )

     

     

    For example, the table below:

     

    Key Check1 Check2 Check3
    A X    
    B   X  
    C X   X
    D     X

     

    "Key" is a text column, while other columns are boolean.

     

    The following formulas would return those results:

     

    Filter(
     table,
     Or(
     Check1 = checkbox1.Value,
     Check2 = checkbox2.Value,
     Check3 = checkbox3.Value
     )
    )

     

     

    Checkboxes Returned records
    Checkbox1 checked [ A ; C ]
    Checkbox2 checked [ B ]
    Checkbox3 checked [ C ; D ]

     

    Hope this was helpful to you.

  • NurSabrina24 Profile Picture
    165 on at
    Re: Filter Dropdown Value Based On OnCheck Checkbox variable

    Let me explain a little bit to confirm this can applied to mine as well..

     

    Form A including checkbox column is for SP A.

    Checkbox column is named as 'Requisition For:' 

    Update property for checkbox column is requisitionfor 

     

    Form B is for SP B

    NurSabrina24_0-1672114209613.png

    SP B is a list where all data has been stored. User don't have to submit for this Form B.

    This 'Material Class:' in SP B is a single line of text type, where I add a combobox in the form to act as filtering the choices.

     To filter the choices, 'Requisition For:' column in SP C (sorry for the mistakes) is the same value as requisitionfor and Material Class combobox choices will be filtered by the value accordingly.

     

    The problem is, if for Items property of the Material Class is:

    Choices('SP B'.'Material Class:')

    Then, it will lists all of the choices. But if I filtered with requisition for:

    Filter('SP B', 'Requisition For:' in requisitionfor).'Material Class:'

    It says, 'We didn't find any data' even if I have oncheck one of the checkboxes. Well, it does result the value of checkbox. 

     

    Other error occurred (other than no data) is, the 'Requisition For:' itself is a red-lined error.

    NurSabrina24_1-1672115259120.png

     

    Hope this explanation helps.

     

    Thank you.

     

     

  • Community Power Platform Member Profile Picture
    on at
    Re: Filter Dropdown Value Based On OnCheck Checkbox variable

    can u check 

    Filter('SP B', 'Requisition For' in requisitionfor).'Material Class:'

     

  • NurSabrina24 Profile Picture
    165 on at
    Re: Filter Dropdown Value Based On OnCheck Checkbox variable

    What do you mean check? Try to retype the code again, is it?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 624 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 384 Super User 2025 Season 2

#3
developerAJ Profile Picture

developerAJ 246

Last 30 days Overall leaderboard