cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
simkessy
Level: Powered On

Dynamic table / gallry rows based on Dropdown selections

I am using the dropdown control for multiple select. I would like that every item selected in the dropdown be reflected in a table below the selection. Is this possible? 

 

Example: 

 

Control has 3 selections: Mike | Janice | Steve (this are names coming from a secondary list)

 

Table / Gallery: 

Name | Title | Age | Gender

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

Mike | CEO | 45| M

Janice | CEO | 49| F

Steve | COO 34| M

 

Then if I select another name in my dropdown or add more, the table should update to reflect the change. 

 

Is this possible in PowerApps?

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

Re: Dynamic table / gallry rows based on Dropdown selections

Hi @simkessy, instead of a dropdown, could I suggest using a combo box? They have a multiselect option built in and to accomplish what you are wanting is a pretty simple chunk of code in your data table/gallery:

 

// In the Items property of your data table/gallery
ComboBox1.SelectedItems

If you use a data table, be sure to select the fields you want to show. They should appear and disappear as selected. 

 

If you really want to use a dropdown, this could be accomplished by putting some code in the OnChange property of your dropdown to add or remove each selected item from a collection, which would be tied to your data table/gallery. Something like:

// In the OnChange property of the dropdown titled Dropdown1
UpdateContext({Dropdown1Reset: false}); If( IsBlank( LookUp( colDropDownItems, Value = Dropdown1.Selected.Value ) ), Collect( colDropDownItems, Dropdown1.Selected ), Remove( colDropDownItems, Dropdown1.Selected ) ); UpdateContext({Dropdown1Reset: true})

Allow me to explain. Essentially this either adds or removes a selected item from a dropdown based on it's exisitance in a collection. There is a local boolean variable, Dropdown1Reset, that is toggled to reset the dropdown so you will need to put the following in the Reset property:

// In the Reset property of Dropdown1
Dropdown1Reset

You would also need to make sure that the AllowUnsetValue property of the dropdown is set to true and the Default property is set to "". This, coupled with the Reset variable will set the dropdown back to a blank value after a selection is made. Otherwise, you will need to select another value to reset a previously selected one.

 

I made a quick demo app to work out the dropdown code and put a combo box demo in there as well. It is attached below. Let me know if I can help out more with this or if I need to explain anything better.

 

View solution in original post

Community Support Team
Community Support Team

Re: Dynamic table / gallry rows based on Dropdown selections

Hi @simkessy 

 

You can reference @wyotim 's suggestion and the comboBox will be convenient for you to achieve this.

ComboBox1.PNG

You can test with his workaround,it describes clearly.

If you have solved your issue ,please accept his workaround as solution.

 

More information:

control-combo-box

control-drop-down

 

Best Regards.

Yumia

View solution in original post

3 REPLIES 3
Super User
Super User

Re: Dynamic table / gallry rows based on Dropdown selections

Hi @simkessy, instead of a dropdown, could I suggest using a combo box? They have a multiselect option built in and to accomplish what you are wanting is a pretty simple chunk of code in your data table/gallery:

 

// In the Items property of your data table/gallery
ComboBox1.SelectedItems

If you use a data table, be sure to select the fields you want to show. They should appear and disappear as selected. 

 

If you really want to use a dropdown, this could be accomplished by putting some code in the OnChange property of your dropdown to add or remove each selected item from a collection, which would be tied to your data table/gallery. Something like:

// In the OnChange property of the dropdown titled Dropdown1
UpdateContext({Dropdown1Reset: false}); If( IsBlank( LookUp( colDropDownItems, Value = Dropdown1.Selected.Value ) ), Collect( colDropDownItems, Dropdown1.Selected ), Remove( colDropDownItems, Dropdown1.Selected ) ); UpdateContext({Dropdown1Reset: true})

Allow me to explain. Essentially this either adds or removes a selected item from a dropdown based on it's exisitance in a collection. There is a local boolean variable, Dropdown1Reset, that is toggled to reset the dropdown so you will need to put the following in the Reset property:

// In the Reset property of Dropdown1
Dropdown1Reset

You would also need to make sure that the AllowUnsetValue property of the dropdown is set to true and the Default property is set to "". This, coupled with the Reset variable will set the dropdown back to a blank value after a selection is made. Otherwise, you will need to select another value to reset a previously selected one.

 

I made a quick demo app to work out the dropdown code and put a combo box demo in there as well. It is attached below. Let me know if I can help out more with this or if I need to explain anything better.

 

View solution in original post

Community Support Team
Community Support Team

Re: Dynamic table / gallry rows based on Dropdown selections

Hi @simkessy 

 

You can reference @wyotim 's suggestion and the comboBox will be convenient for you to achieve this.

ComboBox1.PNG

You can test with his workaround,it describes clearly.

If you have solved your issue ,please accept his workaround as solution.

 

More information:

control-combo-box

control-drop-down

 

Best Regards.

Yumia

View solution in original post

Highlighted
simkessy
Level: Powered On

Re: Dynamic table / gallry rows based on Dropdown selections

Thank you, this was very helpful. I was able to get what I was triyng to do accomplished

 

Helpful resources

Announcements
thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,569)