cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Update Selected Items of Combobox if item is removed from collection

i have a combobox and gallery that i want to mirror each other. Firstly when an item is selected on the combobox i want the collection to be updated. on the other side, when an item is removed from the collection i also want the spectic item o be deselected on the combobox. 
i have only go one side of the solution working, still can't figure how to deselect an item if it is removed from the collection

OnChange of Combox

 

Clear(col_Terms);
Collect(col_Terms,ComboBox1.SelectedItems.Label)

 

items property of Gallery

 

col_Terms

 

Delete item from gallery

 

Remove(col_Terms,{Label: Gallery1.Selected.Label})

 

i just need a way to deselect the deleted item from the combobox. Any ideas

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Helper I
Helper I

Re: Update Selected Items of Combobox if item is removed from collection

@Drrickryp actually your idea was perfect, i just need to put the collection in the defaultselecteditems property, which means that whenever you reset you get the current value of collection selected.

thank you

View solution in original post

3 REPLIES 3
Highlighted
Super User
Super User

Re: Update Selected Items of Combobox if item is removed from collection

Hi @Gottijay1999 

You could use Reset(ComboBoxX) in the gallery but that will remove all of the selected items and the user would have to reselect them from the collection. 

Highlighted
Helper I
Helper I

Re: Update Selected Items of Combobox if item is removed from collection

@Drrickryp I was looking in the way of a symbiotic relationship between the gallery and the combo box, without the user having to reselect items if they are deleted.
is it possible?

Highlighted
Helper I
Helper I

Re: Update Selected Items of Combobox if item is removed from collection

@Drrickryp actually your idea was perfect, i just need to put the collection in the defaultselecteditems property, which means that whenever you reset you get the current value of collection selected.

thank you

View solution in original post

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

Top Solution Authors
Top Kudoed Authors
Users online (7,458)