Skip to main content

Notifications

Community site session details

Community site session details

Session Id : Js1yW1BbQzLFx/SEWRLplS
Power Apps - Building Power Apps
Answered

Update combo box based on selection

Like (0) ShareShare
ReportReport
Posted on 25 Aug 2023 17:53:23 by 314

Is it possible to updated the values selected in a combo box based on a value in that same combo box?

 

Scenario: I have an app that tracks tasks for employees.  There is a "Task Name" column and then there is a "Tasked To" column.  The Task To column has choices for Employee A, Employee B, Employee C, All Employees.  This is a multi select column.  If the user selects All Employees along with other choices, I would like for only the All Employees choice to remain.  Is this possible?  

Categories:
  • Alex-W Profile Picture
    314 on 25 Aug 2023 at 21:12:36
    Re: Update combo box based on selection

    One thing to add to this solution.  If you are using a combo box with a single line of text column on the SharePoint list, you can use the steps that @Rusk provided.  If you are using a combo box with a choice column on the SharePoint list, you must add .Value after ComboxBox1.SelectedItems.  

     

  • Alex-W Profile Picture
    314 on 25 Aug 2023 at 20:54:28
    Re: Update combo box based on selection

    @Rusk 

     

    Not a nice user experience?  This is awesome and it works just the way I was expecting!  Thanks for the help with this!!

  • Verified answer
    Rusk Profile Picture
    1,369 Super User 2024 Season 1 on 25 Aug 2023 at 18:51:33
    Re: Update combo box based on selection

    Hi @Alex-W 

     

    It is possible, but it's not a nice user experience.  If you are wanting to display certain items when "All Employees" are in the combo box, you can use "in" in your formula to filter it.

    The combo box returns a table as seen below.  You can just use "All Employees" in ComboBox1.SelectedItems to apply logic triggered by "All Employees" being selected.

    Rusk_0-1692987754145.png

     

    But if you really want to force it to "All Employees" when "All Employees" is selected, try this:

     

    1) Set the "OnChange" formula to something like this:

    Rusk_2-1692989250350.png

     

    If("All Employees" in ComboBox1.SelectedItems,
    Set(varAllEmployees,true),
    Set(varAllEmployees,false))

     

     

    2) Set your "DefaultSelectedItems" formula to check for "All Employees" being selected:

     

    If(varAllEmployees = true, {Value: "All Employees"}, Blank())

     

     

    Rusk_3-1692989302869.png

     

    Now, if they choose "All Employees", it will reset the box back to your default "All Employees".  Its kind of a bummer solution though, as its jarring to the user.  Unselecting "All Employees" resets the box also, not great.

    I would recommend just use "All Employees" in ComboBox1.SelectedItems to do whatever it is you're looking to accomplish with having only "All Employees" in the combo box

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,786 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,093 Most Valuable Professional

Leaderboard
Loading started