web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Adding items selected ...
Power Apps
Unanswered

Adding items selected from combo-box (lookup) to collection

(0) ShareShare
ReportReport
Posted on by 183

Hello all,

 

I have a combo-box called 'reviewComboBox' (that contains items pulled from a Lookup column) inside my application. Some of the items are: January, February, March, April, May ... and so on.

 

My combo-box allows for multiple selections. I would like for: when the user selects multiple items and submits the form once they have made all their changes (ex: selecting what items they'd like, and de-selecting what they would not like if they change their mind), the items selected in that combo-box will be added together to a collection in the form of a table. Here's a visual of the collection I'd like if the 3 items:  'January' , 'February' , and 'March' are selected in the combo-box -->

jharville1_0-1605735362624.png

I have tried the following code in both the "OnSelect" and "OnChange" properties (in the 'Advanced Properties') section of my combo-box, but nothing is collected at all...                   Does anybody see any issue with my code?

 

jharville1_0-1605736412768.png

-----------------------------------------------------------

jharville1_0-1605735730820.png

 

 

 

 

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @jharville1 

    So, is there a particular need to create a collection of items?  Your ComboBox SelectedItems property is already a table of selected items.  You can reference that any place in your app -  yourComboBox.SelectedItems

     

    If you need a collection for some reason, then you can do the following:  ClearCollect(colReviewItems, yourComboBox.SelectedItems)

    But again...this is what you already have in the property SelectedItems of the combobox.

     

    I hope this is helpful for you.

  • jharville1 Profile Picture
    183 on at

    Thank you for the response, I really appreciate it. I was actually editing the screenshot of my original post to show the actual formula I used, which was promoComboBox.SelectedItems   , the formula you mentioned.

     

    Oddly enough, that still didn't populate anything inside my collection. The reason why I am trying to collect the items from the combo-box is I'm building an 'Approvals' application. I already have it built (and functional) so that an approval is made on the entire form that is submitted... but I want to tweak the app so that it creates approvals for each of the items selected in the combo-box. The application: consists of one form with a combo-box section in it (and an input text field where the user inserts their name). Each item selection within the combo-box will route the form to a specific person, since the look-up that my combo-box is using has 2 columns. One for the item (ex: January), and the second column for an email address.

     

    ex: January emails (routes) the form to Jane Doe for approval of that 1 item (January), while February emails the form to Bob Smith and Dan Carr for approval of that 1 item (February). If both January and February are selected, all 3 of the users stated will be sent an email for approval of those 2 items (January and February).

     

    My goal is to add those items selected to the collection, write code to have a count of how many items are in that collection, and then create sub-approvals for each item with a patch.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard