# Dropdown Default Value

**URL:** <https://forum.inductiveautomation.com/t/dropdown-default-value/73052>\
**Category:** General Discussion\
**Created:** [April 29, 2023, 11:37am UTC](https://forum.inductiveautomation.com/t/dropdown-default-value/73052 "2023-04-29T11:37:54Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Sheldon-Colli](https://avatars.discourse-cdn.com/v4/letter/d/278dde/32.png) [@Daniel\_Sheldon-Colli](https://forum.inductiveautomation.com/u/Daniel_Sheldon-Colli)\
**Post date:** [April 29, 2023, 11:37am UTC](https://forum.inductiveautomation.com/t/dropdown-default-value/73052/1 "2023-04-29T11:37:54Z")

</div>

Hello,  
New to Ignition

Hope everyone is well,  
i have two drop down menus, one selects the variable name i want to write to and the other is the variable value, the first defaults to the first in the list, but the second i want to display the value from the variable, i cant figure out how this is done, any ideas would be great thank you.

---

<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:** [April 29, 2023, 11:52am UTC](https://forum.inductiveautomation.com/t/dropdown-default-value/73052/2 "2023-04-29T11:52:39Z")

</div>

You would use [indirect binding](https://www.inductiveuniversity.com/video/search/?q=indirect%20binding) on the second component. But it will be very complicated if the choices for the second component vary per variable allowed.

---

<div class="post-metadata">

**Author:** ![craigb](https://avatars.discourse-cdn.com/v4/letter/c/9f8e36/32.png) [@craigb](https://forum.inductiveautomation.com/u/craigb)\
**Post date:** [April 29, 2023, 2:04pm UTC](https://forum.inductiveautomation.com/t/dropdown-default-value/73052/3 "2023-04-29T14:04:50Z")

</div>

If I'm reading this right, your first drop down alters what appears in the second drop down ?

If your info is in a database you can use a named query on the second drop down using the first drop down as the parameter.

[https://docs.inductiveautomation.com/display/DOC81/Named+Queries](https://docs.inductiveautomation.com/display/DOC81/Named+Queries)

---

<div class="post-metadata">

**Author:** ![Daniel\_Sheldon-Colli](https://avatars.discourse-cdn.com/v4/letter/d/278dde/32.png) [@Daniel\_Sheldon-Colli](https://forum.inductiveautomation.com/u/Daniel_Sheldon-Colli)\
**Post date:** [April 29, 2023, 9:44pm UTC](https://forum.inductiveautomation.com/t/dropdown-default-value/73052/4 "2023-04-29T21:44:34Z")

</div>

Hi Thanks for the relays. Sorry only new to ignition so didn't realy explain very well.

Dropdown one is set up as indirect, it selects different motors within a PLC eg motor 1 motor 2 motor 3. Then below the motors is some guages with RPM temp and so on for that motor set and these change based on the motor set selected. The second drop down sets the motor speed. 3 pre set mixing speeds 750 RPM 1500RPM 2000 RPM, so what I want to happen is when you select motor drop down the other drop down charges to the current RPM setting.

Hope this is clearer.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [April 29, 2023, 10:31pm UTC](https://forum.inductiveautomation.com/t/dropdown-default-value/73052/5 "2023-04-29T22:31:15Z")

</div>

Why not use the indirect binding technique on the second dropdown as well?

See [Perspective indirect tag binding](https://docs.inductiveautomation.com/display/DOC81/Tag+Bindings+in+Perspective#TagBindingsinPerspective-IndirectTagBindingMode).

---

<div class="post-metadata">

**Author:** ![Daniel\_Sheldon-Colli](https://avatars.discourse-cdn.com/v4/letter/d/278dde/32.png) [@Daniel\_Sheldon-Colli](https://forum.inductiveautomation.com/u/Daniel_Sheldon-Colli)\
**Post date:** [April 30, 2023, 2:04am UTC](https://forum.inductiveautomation.com/t/dropdown-default-value/73052/6 "2023-04-30T02:04:21Z")

</div>

I have and it sets the variable as wanted. But when you select the first dropdown I want the second drop down to show what it is set to.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [April 30, 2023, 8:52am UTC](https://forum.inductiveautomation.com/t/dropdown-default-value/73052/7 "2023-04-30T08:52:45Z")

</div>

If you've got the indirect tag binding setup correctly on the 2nd dropdown, you should correctly see the value of the selected motor in dropdown 1. Screenshots speak 1000 words 🙂

---

<div class="post-metadata">

**Author:** ![Daniel\_Sheldon-Colli](https://avatars.discourse-cdn.com/v4/letter/d/278dde/32.png) [@Daniel\_Sheldon-Colli](https://forum.inductiveautomation.com/u/Daniel_Sheldon-Colli)\
**Post date:** [April 30, 2023, 9:24am UTC](https://forum.inductiveautomation.com/t/dropdown-default-value/73052/8 "2023-04-30T09:24:33Z")

</div>

Hi everything is set up correctly from what I can see, dropdown 1 changes the variable / motor selection and Dropdown 2 sets the speed and writes to the PLC. No issues.

But when you change dropdown one the second dropdown where you set the RPM goes back to the placeholder text. Even though the Varable has RPM already set.

I'll take some screens shots tomorrow if needed

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [April 30, 2023, 9:36am UTC](https://forum.inductiveautomation.com/t/dropdown-default-value/73052/9 "2023-04-30T09:36:49Z")

</div>

Sounds like the rpm value isn't in the list, or your list value is a different type to the tag's value. E.g. It's a string perhaps?

---

<div class="post-metadata">

**Author:** ![Daniel\_Sheldon-Colli](https://avatars.discourse-cdn.com/v4/letter/d/278dde/32.png) [@Daniel\_Sheldon-Colli](https://forum.inductiveautomation.com/u/Daniel_Sheldon-Colli)\
**Post date:** [April 30, 2023, 9:56am UTC](https://forum.inductiveautomation.com/t/dropdown-default-value/73052/10 "2023-04-30T09:56:58Z")

</div>

Nope because it all works.eg. you select motor set 3 from dropdown then set 750RPM from dropdown 2 this writes to the PLC no issues select motor 1 and the swap back straight back to motor 3 and it just displays the placeholder. Not the set value and 750rpm INT is still in the PLC.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [April 30, 2023, 10:09am UTC](https://forum.inductiveautomation.com/t/dropdown-default-value/73052/11 "2023-04-30T10:09:00Z")

</div>

It'll still write the value correctly if it's a string in the dropdown as it'll convert it implicitly, it just may not display it correctly

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [April 30, 2023, 12:42pm UTC](https://forum.inductiveautomation.com/t/dropdown-default-value/73052/12 "2023-04-30T12:42:26Z")

</div>

Paste the JSON for your Dropdown2 options list so we can see what's going on.

Anyway, it doesn't sound like a good machine GUI. If anyone adds or sets a different RPM on the motor then your HMI will fail. Dropdowns are not usually used for industrial control user interfaces.

To get up to date on current HMI design recommendations have a look at [High Performance HMI Design Basics](https://www.youtube.com/watch?v=HCrCrpF7mUo&t=145s&ab_channel=RealPars) on YouTube.

---

<div class="post-metadata">

**Author:** ![Daniel\_Sheldon-Colli](https://avatars.discourse-cdn.com/v4/letter/d/278dde/32.png) [@Daniel\_Sheldon-Colli](https://forum.inductiveautomation.com/u/Daniel_Sheldon-Colli)\
**Post date:** [April 30, 2023, 10:14pm UTC](https://forum.inductiveautomation.com/t/dropdown-default-value/73052/13 "2023-04-30T22:14:09Z")

</div>

nminchin, make sense, if it is a string how do I change it from string to INT.

---

<div class="post-metadata">

**Author:** ![Daniel\_Sheldon-Colli](https://avatars.discourse-cdn.com/v4/letter/d/278dde/32.png) [@Daniel\_Sheldon-Colli](https://forum.inductiveautomation.com/u/Daniel_Sheldon-Colli)\
**Post date:** [April 30, 2023, 10:15pm UTC](https://forum.inductiveautomation.com/t/dropdown-default-value/73052/14 "2023-04-30T22:15:45Z")

</div>

Transistor. How do I download the json file, as said only new.

And the RPM is only set by one operator from one place. No one else has access.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [April 30, 2023, 10:24pm UTC](https://forum.inductiveautomation.com/t/dropdown-default-value/73052/15 "2023-04-30T22:24:29Z")

</div>

Right-click on `props.options` and select _Copy_.  
Paste into your post and format it as code using the \</\> button. It should look something like this:

```auto
[
  {
    "value": "600",
    "label": "600 RPM"
  },
  {
    "value": "900",
    "label": "900 RPM"
  },
  ...
]

```

---

<div class="post-metadata">

**Author:** ![Daniel\_Sheldon-Colli](https://avatars.discourse-cdn.com/v4/letter/d/278dde/32.png) [@Daniel\_Sheldon-Colli](https://forum.inductiveautomation.com/u/Daniel_Sheldon-Colli)\
**Post date:** [April 30, 2023, 10:27pm UTC](https://forum.inductiveautomation.com/t/dropdown-default-value/73052/16 "2023-04-30T22:27:36Z")

</div>

I'll be in front of my computer in an hour I'll take screen shots and copy paste code.

Thanks for the help.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [April 30, 2023, 10:34pm UTC](https://forum.inductiveautomation.com/t/dropdown-default-value/73052/17 "2023-04-30T22:34:53Z")

</div>

I'll be asleep in Ireland. Good night.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [April 30, 2023, 11:26pm UTC](https://forum.inductiveautomation.com/t/dropdown-default-value/73052/18 "2023-04-30T23:26:12Z")

</div>

I'll be here, not sleeping, very much awake 😵‍💫 Start of my Monday

---

<div class="post-metadata">

**Author:** ![Daniel\_Sheldon-Colli](https://avatars.discourse-cdn.com/v4/letter/d/278dde/32.png) [@Daniel\_Sheldon-Colli](https://forum.inductiveautomation.com/u/Daniel_Sheldon-Colli)\
**Post date:** [April 30, 2023, 11:58pm UTC](https://forum.inductiveautomation.com/t/dropdown-default-value/73052/19 "2023-04-30T23:58:52Z")

</div>

Here is the prop.options for both the dropdowns

```auto

#Dropdown 1
[
  {
    "value": 3,
    "label": "Hopper 3"
  },
  {
    "value": 4,
    "label": "Hopper 4"
  },
  {
    "value": 5,
    "label": "Hopper 5"
  },
  {
    "value": 6,
    "label": "Hopper 6"
  }
]

#Dropdown 2
[
  {
    "value": 0,
    "label": "Stop"
  },
  {
    "value": 750,
    "label": "Slow Speed"
  },
  {
    "value": 1500,
    "label": "Medium Speed"
  },
  {
    "value": 2000,
    "label": "High Speed"
  },
]

```

---

<div class="post-metadata">

**Author:** ![Daniel\_Sheldon-Colli](https://avatars.discourse-cdn.com/v4/letter/d/278dde/32.png) [@Daniel\_Sheldon-Colli](https://forum.inductiveautomation.com/u/Daniel_Sheldon-Colli)\
**Post date:** [May 1, 2023, 12:00am UTC](https://forum.inductiveautomation.com/t/dropdown-default-value/73052/20 "2023-05-01T00:00:07Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/b/5b6ce57b8e80dfa29147d0a151f7274fa95c9dce.png)

Dropdown 1 action

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/7/1756cccafe648b2a0bf7cca68f9cbb967500cd6c.png)

Dropdown 2 action

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/9/e916fb7eb691041cf70948d6463cb2f090ce426a.png)

[Next page](https://forum.inductiveautomation.com/t/dropdown-default-value/73052.md?page=2)
