Notifications
Announcements
I have a few different listbox controls whose items are from a SharePoint list. Each item has a numerical score associated with it. When the end user selects an item, it is easy to set a global variable to that accumulated value (for each selected). But if they unselect an item is there a simple way to subtract that score from the cumulated value. I did not see an unselect function for a listbox. How might I be able to do this? Thanks for the advice
@guyinkalamazoo
You really don't need to do any variable setting for the control. It already has the list of items selected that you want.
If you refer to the SelectedItems of the list box, it will contain anything selected. It will always reflect what is selected in the list.
Setting a variable for this would be very "program-like" and PowerApps is not a development platform. So consider just referencing the control in your app.
Ex. Listbox1 on the screen with the appropriate Items property.
To see the selected...(as an example) put another list box on the screen and set the Items property to Listbox1.SelectedItems
I hope this is helpful for you.
Yes, this is very helpful and I am hoping I can wrap a Sum() around the lb.SelectedItems. That would be perfect. Thanks for the information
Yes, you can...
ex. Sum(lb.SelectedItems, someValue)
Just keep one thing in mind about list boxes - you CANNOT automatically select items in the list. This is a long running issue about Listboxes and very annoying if you want to use one to display some values that are in some datasource.
Not sure if that is a factor for you going forward, but wanted to point it out.
Thanks again. This will work for me as I do not need anything preselected. I just subbed to your channel too 🙂
Good deal...then the Listbox will do the trick.
And thanks for subbing to the channel!! I am really behind on posting videos, but have it on my schedule before year end.
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.
In our never-ending quest to improve we are simplifying the forum hierarchy…
We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
WarrenBelz 717 Most Valuable Professional
Michael E. Gernaey 329 Super User 2025 Season 2
Power Platform 1919 268