Announcements
Hello and good morning.I have been banging my head against the wall trying to figure this out, without success.I have a multiselect combo box having various Software program titles.Fields are:ProgramName (Multi Select)MachineName (Single Line Text)UserName (Person/Group)What would like to do is update my SharePoint list "Software Users" with a separate record for each multi select choice that was made. Then update the "Software License" list that shows how many licenses are allocated for each title, the count of licenses used and the total remaining licenses. The scenario is: Person "A" is hired, and a PC is loaded with various software titles, each title allocated to the PC must be accounted for and the license count updated. It would be nice if the power app can show a label warning when zero licenses are available.Any ideas would be helpful.Thank you.
Hello @golfnutt82 ,
I suggest using "ForAll()".
"ForAll()" process a batch of commands for each record in a table you provide. For example, for each selected items in your ComboBox, you could "Patch()" the corresponding item in your list.
ForAll( ComboBox.SelectedItems, With( { _licence:LookUp('Software Licence', Title = ThisRecord.Title) }, Patch( 'Software Licence', _licence, {count:_licence.count-1} ) ) )
what is _License or _Licnese.count what does _license refer to?
It's part of the "With()" function.
"With()" creates a local context in runtime where you can quickly define temporary variables that automatically expires at the end of the function.
Here, I'm declaring a "_licence" variable that stores the corresponding record from "Software Licence" list so I don't have to use "LookUp()" twice in the "Patch()". Basically, it saves performance and eases readability.
"_licence" is the record from your list you want to patch.
"_licence.count" is the licence's current count so you can decrement or increment it.
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.
Congratulations to our community stars!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
11manish 243 Super User 2026 Season 2
WarrenBelz 204 Most Valuable Professional
Mohsin Ali 122