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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filtering Combobox bas...
Power Apps
Answered

Filtering Combobox based on toggle on / off

(0) ShareShare
ReportReport
Posted on by 34

This is likely very simple (if it's even possible) but I am extremely new to PowerApps so please bear with me.

 

I am building a PowerApp (not customized form) connected to a Sharepoint List on the back-end.

I have a Combobox on a Datacard called 'cbDivision' that is pulling a list of numbers from SharePoint as such:

100

P100

200

P200 

so on and so forth.

I have a on/off toggle called 'tglProposal' which will be controlled by the user whether it is a proposal being submitted or not.

 

What I want to do:

If the toggle is turned off, I want the combobox items to only show the '100,200,300'..etc rows. When the toggle is turned on, I only want the combobox to show the 'P100, P200, P300...' rows.

 

What I have so far:

in the Items property of the 'cbDivision' Combobox, I have:

If(tglProposal.Value= false ,Choices([@'GIS and Drafting Workflow'].Division),tglProposal.Value= true,Choices([@'GIS and Drafting Workflow'].Division,"P100"))

 

This works and gives me the desired result, but only P100 is shown, as expected. However, no matter what syntax I try, I cannot add MORE than one searchtext in the Choices(column, searchtext). Am I missing some available syntax? Is this even possible?

Is there an easier way to accomplish what I'm trying to do?

 

 I can provide any screenshot or additional detail if necessary

Thank you very much for reading

Categories:
I have the same question (0)
  • SimonPiquer Profile Picture
    255 on at

    Hi,

     

    I may have misunderstood you, buy wouldn't a Filter work instead of Choices?

     

    If(
     tglProposal.Value = false,
     'GIS and Drafting Workflow'.Division,
     Filter(
     'GIS and Drafting Workflow'.Division,
     StartsWith(
     Division,
     "P"
     )
     )
    )
  • Verified answer
    v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @kchubala ,

    Could you tell me the data type of Division field?

    I assume that it is choice type and its choices are :

    100

    P100

    200

    P200 

    If so, do you want to display different choices based on the toggle's value?

    Try to set the combo box's Items:

    If(tglProposal.Value= false ,
     Filter(
     Choices([@'GIS and Drafting Workflow'].Division),
     Not("P" in Value)
     ),
    //filter the choices of Division field, with value not having "P"
     tglProposal.Value= true,
     Filter(
     Choices([@'GIS and Drafting Workflow'].Division),
     "P" in Value
     )
    //filter the choices of Division field, with value having "P"
     )

     

     

     

    Best regards,

  • kchubala Profile Picture
    34 on at

    Thank you! This works perfectly! The part I wasn't grasping was that you can reference 'Value' on its own. 

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 179

Last 30 days Overall leaderboard