# Dropdown List Binding

**URL:** <https://forum.inductiveautomation.com/t/dropdown-list-binding/10550>\
**Category:** Ignition\
**Created:** [September 29, 2015, 9:15pm UTC](https://forum.inductiveautomation.com/t/dropdown-list-binding/10550 "2015-09-29T21:15:28Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![DT1](https://avatars.discourse-cdn.com/v4/letter/d/90ced4/32.png) [@DT1](https://forum.inductiveautomation.com/u/DT1)\
**Post date:** [September 29, 2015, 9:15pm UTC](https://forum.inductiveautomation.com/t/dropdown-list-binding/10550/1 "2015-09-29T21:15:28Z")

</div>

I’m having trouble binding a tag in a Dropdown list. It seems to work backwards…  
When I bind a tag {PartSelected} to the ‘Selected String Value’, it does not write the selected value to the tag its binded to. In other words, I select a value of ‘7’ from Dropdown, that value is in the ‘Selected String Value’, but it does not make it to the {PartSelected} tag that I bind to that value. However, if I modify the value of the {PartSelected} tag, it updates the Dropdown list. This seems backwards, the goal here is to use a dropdown list to fill a tag with the value selected. I even tried writing a property change script, but it does the same thing.

---

<div class="post-metadata">

**Author:** ![AlThePal](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/althepal/32/3603_2.png) [@AlThePal](https://forum.inductiveautomation.com/u/AlThePal)\
**Post date:** [September 29, 2015, 9:23pm UTC](https://forum.inductiveautomation.com/t/dropdown-list-binding/10550/2 "2015-09-29T21:23:27Z")

</div>

On your binding make sure you tick the ‘Bidirectional’ option. This allows the Dropdown List to write its value back to the tag. Note that updating the value of the tag directly will still update the List - I don’t think it’s possible to stop this.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 29, 2015, 9:26pm UTC](https://forum.inductiveautomation.com/t/dropdown-list-binding/10550/3 "2015-09-29T21:26:23Z")

</div>

Did you check “bidirectional” when you created the binding? That’s almost certainly what you are looking for.

---

<div class="post-metadata">

**Author:** ![Dtooley](https://avatars.discourse-cdn.com/v4/letter/d/b19c9b/32.png) [@Dtooley](https://forum.inductiveautomation.com/u/Dtooley)\
**Post date:** [December 4, 2016, 3:17pm UTC](https://forum.inductiveautomation.com/t/dropdown-list-binding/10550/4 "2016-12-04T15:17:27Z")

</div>

Thanks for the responses, that was it. ![:thumb_left:](https://us1.discourse-cdn.com/inductiveautomation/original/1X/e26afb081ddde6df016df6ee49159cf56aaca688.gif ":thumb\_left:")

---

<div class="post-metadata">

**Author:** ![alexm](https://avatars.discourse-cdn.com/v4/letter/a/3da27b/32.png) [@alexm](https://forum.inductiveautomation.com/u/alexm)\
**Post date:** [July 9, 2019, 2:44pm UTC](https://forum.inductiveautomation.com/t/dropdown-list-binding/10550/5 "2019-07-09T14:44:50Z")

</div>

I am trying to create a Dropdown in Perspective setting 3 states( 0-Off,1-Slow,2-Fast) with main goal ,every time I select a label from the dropdown change the integer on the PLC code. Ive started with binding the Tag on the PLC on the params as a “value”. Then on the actual component(dropdown) I have named the labels for every value under options, and the values are binded to the (params/value) from the actual window. It doesnt seem to be working despites I am only being able to read the tag when I change it from the PLC. Any ideas would be much appreciated.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [July 9, 2019, 3:26pm UTC](https://forum.inductiveautomation.com/t/dropdown-list-binding/10550/6 "2019-07-09T15:26:26Z")

</div>

The following component worked for me. It is bi-directionally bound to a tag.  
Check that your binding is bi-directional (and saved).  
Check that you have read-write enabled (Project \> Comm Read/Write).  
If those requirements are in place, check the logs on the Gateway to see what could be preventing the write.

```auto
[
  {
    "type": "ia.input.dropdown",
    "version": 0,
    "props": {
      "options": [
        {
          "value": 0,
          "label": "Off"
        },
        {
          "value": 1,
          "label": "Slow"
        },
        {
          "value": 2,
          "label": "Fast"
        }
      ]
    },
    "meta": {
      "name": "Dropdown"
    },
    "position": {
      "height": 36,
      "width": 256,
      "x": 273,
      "y": 133
    },
    "custom": {},
    "propConfig": {
      "props.value": {
        "binding": {
          "type": "tag",
          "config": {
            "mode": "direct",
            "tagPath": "[default]Experimentation/IntRepl",
            "bidirectional": true,
            "fallbackDelay": 2.5
          }
        }
      }
    }
  }
]

```

---

<div class="post-metadata">

**Author:** ![alexm](https://avatars.discourse-cdn.com/v4/letter/a/3da27b/32.png) [@alexm](https://forum.inductiveautomation.com/u/alexm)\
**Post date:** [July 10, 2019, 9:17am UTC](https://forum.inductiveautomation.com/t/dropdown-list-binding/10550/7 "2019-07-10T09:17:40Z")

</div>

Thank you very much for your script is much appreciated. As I am very new with python and scripting, may I ask where shall I include this? Also it gives me a syntax error on line 1 which doesn’t make sense atm.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [July 10, 2019, 2:14pm UTC](https://forum.inductiveautomation.com/t/dropdown-list-binding/10550/8 "2019-07-10T14:14:50Z")

</div>

What I supplied was not Python, it was a JSON object which defines a Dropdown in Perspective. You should be able to copy what I supplied to your clipboard and then paste it directly into your View. Once the Dropdown is in place, you will want to replace the tag path in the binding with your tag path.

When you initially paste the Dropdown, you’ll see a warning in the Property Editor on the `Dropdown.props.value` property, which is due to the fact that my tag path doesn’t exist in your project.
