Hi everyone, today I'm trying to create a progress bar that is linked to a combobox ('2023Goals_ComboBox') that lists my team's 2023 goals. I want the progress bar to increase each time another item (goal) is selected, and the bar to go from red to green when all the items are selected and the bar is at 100%.
My app is a customized SharePoint list form (list is called 'AccessibilityReport'), and the combobox in question is attached to a choice column ('2023 Metrics').
I've been able to configure a toggle to go from "No" to "Yes" when all the items in the combobox are selected but it's just not nearly as satisfying. Any insight would be really appreciated!
Well, in case anyone wants to know, I figured it out. I added a slider element and set the Min property to 0, and the Max property to:
CountRows(Choices([@AccessibilityReport].'2023 Metrics'))
where AccessibilityReport is the name of my list and 2023 Metrics is the name of my choice column. Then I set the Default to
CountRows('2023Goals_ComboBox'.SelectedItems)
To achieve the color portion of my goal, I entered the following code into the ValueFill field:
If(
IsBlank('2023Goals_ComboBox'.SelectedItems),
RGBA(200, 200, 200, 100),
Switch(
true,
CountRows('2023Goals_ComboBox'.SelectedItems) < Slider1.Max, RGBA(45, 49, 121, 1),
CountRows('2023Goals_ComboBox'.SelectedItems) = 0, RGBA(200, 200, 200, 100),
CountRows('2023Goals_ComboBox'.SelectedItems) = CountRows(Choices([@AccessibilityReport].'2023 Metrics')), RGBA(31, 81, 49, 1)
)
)
Note that I ended up using blue and green as my indicator colors instead of red and green, per accessibility guidelines.
Also, so that no one would mess with it, I changed DisplayMode to DisplayMode.View.
Here's a picture of the progress bar when it's partially full (there are 7 items you can select from in the 2023 goals met combobox) :
Here's how it looks when all items are selected (I have an If function set on the 2023 goals progress text label so it updates if you've completed the goals):
WarrenBelz
146,618
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,957
Most Valuable Professional