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?
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.
Not a nice user experience? This is awesome and it works just the way I was expecting! Thanks for the help with this!!
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.
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:
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())
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
WarrenBelz
146,786
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,093
Most Valuable Professional