# Comparing data sets on two drop down lists

**URL:** <https://forum.inductiveautomation.com/t/comparing-data-sets-on-two-drop-down-lists/10267>\
**Category:** Ignition\
**Created:** [July 24, 2015, 11:38am UTC](https://forum.inductiveautomation.com/t/comparing-data-sets-on-two-drop-down-lists/10267 "2015-07-24T11:38:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![the\_newb](https://avatars.discourse-cdn.com/v4/letter/t/9de0a6/32.png) [@the\_newb](https://forum.inductiveautomation.com/u/the_newb)\
**Post date:** [July 24, 2015, 11:38am UTC](https://forum.inductiveautomation.com/t/comparing-data-sets-on-two-drop-down-lists/10267/1 "2015-07-24T11:38:30Z")

</div>

Hello,

In a window in the vision module, I have two drop down lists, they have the exact same data set.

For this lets say my data set is 2 columns, 3 rows…

Data set 1 Data set 2  
(value, label) (value, label)

1, data 1 1, data 1  
2, data 2 2, data 2  
3, data 3 3, data 3

How can I configure the drop down list for data set 2, so it cannot select the same data that is selected in data set 1?

So if I selected “data 1” in drop down list 1, it would be awesome if “data 1” didn’t show up in drop down list 2, but if that’s not possible, I at least need it so that it is not selectable.

I found a way to do this by using an expression binding on the value of drop down list 2, but I can’t do that because I need the value to be bound to another tag that I pass back to a PLC.

Any ideas???

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [July 24, 2015, 6:04pm UTC](https://forum.inductiveautomation.com/t/comparing-data-sets-on-two-drop-down-lists/10267/2 "2015-07-24T18:04:39Z")

</div>

This will take that dataset in the first dropdown, delete the selected row, then move the resultant dataset into the other dropdown.

In a propertyChange script:

`if event.propertyName=="selectedIndex":
  dataIn=event.source.data
  if event.newValue != -1:
    dataOut=system.dataset.deleteRow(dataIn,event.newValue)
    event.source.parent.getComponent('Dropdown 2').data=dataOut
    event.source.parent.getComponent('Dropdown 2').selectedIndex=-1
  else:
    event.source.parent.getComponent('Dropdown 2').data=dataIn`

Here is a sample window.  
[dropdown\_2015-07-24\_1358.proj](https://us1.discourse-cdn.com/inductiveautomation/original/2X/8/8110dc48613bd6d2aa11633447b097c2c8a54e27.proj) (7.18 KB)
