cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jharville1
Helper IV
Helper IV

Display items selected in combo-box in a Gallery

Hello! I have a combo-box in a form that allows users to choose one or more options from a selection of items. Some of the items in the combo-box are: "January", "February", "March", "April", and so on. The items in the list are pulled from a Lookup column in a SharePoint list ('review materials'), under the "Title" column.

 

jharville1_3-1606945316378.png

 

 

I have successfully used code to add whatever item the user selects to a collection, and pull in the corresponding email address to the same collection table but in the column to the right. The following is an example if the user selects "January" and "February"

jharville1_4-1606945348900.png

 

My application is an "Approvals" application, where all approvals are done in a Gallery (on the right side of the screen of the same screen as the details section of the submitted form). Each item selected in my combo-box is what is going to be approved. How would I display each item selected in my combo-box in separate sections of my Gallery?

 

For example: If the user selects: "January" , "February", "March" in my combo-box of the form, it should list out each selection separately in the Gallery. But currently, when I use this code: 'reviewComboBox.Selected.Value' (reviewComboBox is the name of my combo-box, and the Display Name in my form is "Review Material") in the 'Text' property, it shows this in my Gallery:

 

reviewmaterialexample.png

 

The first item chosen from the combo-box is shown 3 times, instead of each of the 3 items chosen from the combo-box shown once. I tried using the .SelectedItems code but it doesn't work as we need a text output, not a table.

 

 

Thank you!!

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@jharville1 

You would need to set the Gallery Items to the following:

    reviewComboBox.SelectedItems

 

Then in your Gallery, you reference the items directly.  This will depend on the Items property of your Combobox.

But as an example, if your Combobox only have records with a Value column, then in your Gallery, your Text property would be ThisItem.Value

If the records defined in the Items of the ComboBox have your "Item" column, then your Text property in the Gallery would be ThisItem.Item

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

2 REPLIES 2
RandyHayes
Super User
Super User

@jharville1 

You would need to set the Gallery Items to the following:

    reviewComboBox.SelectedItems

 

Then in your Gallery, you reference the items directly.  This will depend on the Items property of your Combobox.

But as an example, if your Combobox only have records with a Value column, then in your Gallery, your Text property would be ThisItem.Value

If the records defined in the Items of the ComboBox have your "Item" column, then your Text property in the Gallery would be ThisItem.Item

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Thank you as always, the solution was ThisItem.Title since that was what was used in the naming convention. The same thing as what you said but different name for the variable. I appreciate the help Randy!

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Solution Authors
Top Kudoed Authors
Users online (1,232)