# Dropdown pre select

**URL:** <https://forum.inductiveautomation.com/t/dropdown-pre-select/104837>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [April 8, 2025, 3:27pm UTC](https://forum.inductiveautomation.com/t/dropdown-pre-select/104837 "2025-04-08T15:27:44Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![pick](https://avatars.discourse-cdn.com/v4/letter/p/9de0a6/32.png) [@pick](https://forum.inductiveautomation.com/u/pick)\
**Post date:** [April 8, 2025, 3:27pm UTC](https://forum.inductiveautomation.com/t/dropdown-pre-select/104837/1 "2025-04-08T15:27:44Z")

</div>

Hello,  
I have 3 dropdown like this:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/6/c6b4c7aed9aa8237708d06853c420c469dd21dc6.png)  
I would like to pre-select them by script at start up.  
Trying to write to returnValue didn't work.  
Does anyone have an idea?  
Thanks.

---

<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 8, 2025, 3:35pm UTC](https://forum.inductiveautomation.com/t/dropdown-pre-select/104837/2 "2025-04-08T15:35:25Z")

</div>

Show us the binding between the dropdown and the view `params.returnValue`.

---

<div class="post-metadata">

**Author:** ![pick](https://avatars.discourse-cdn.com/v4/letter/p/9de0a6/32.png) [@pick](https://forum.inductiveautomation.com/u/pick)\
**Post date:** [April 8, 2025, 5:26pm UTC](https://forum.inductiveautomation.com/t/dropdown-pre-select/104837/3 "2025-04-08T17:26:35Z")

</div>

Thank you for your quick reply. I do not have binding, I just have tried to write from start up script "workshop A" by exemple and check if it indicate "workshop A" instead of "Select" on the dropdown main line. But it may not be the best way for pre-selection on opening view ...

---

<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 8, 2025, 5:41pm UTC](https://forum.inductiveautomation.com/t/dropdown-pre-select/104837/4 "2025-04-08T17:41:49Z")

</div>

![Dropdown binding](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/c/1c7b5078e2a81d96478a19ba53f67ac60fee91a8.png)

To programmatically select an option you set the value to the option you want.

View parameters are read once at startup.

- Create a property binding on `value` and point it at `view.params.returnValue` (which you should have added to the dropdown view).
- You may want to set the binding as bidirectional if you want to read it back from the main view.
- Then feed the value you want into `params.returnValue` on your embedded view.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [April 8, 2025, 6:45pm UTC](https://forum.inductiveautomation.com/t/dropdown-pre-select/104837/5 "2025-04-08T18:45:48Z")

</div>

I'd advise against putting startup scripts everywhere. Bindings are, most of the time, the way to go.

In your example:  
Make returnValue bidirectional.  
Then bind the dropdown's value to that parameter. Make this binding bidirectional.

Note: In this situation, I like having an input parameter, binding the dropdown to it, then an output parameter, bound to the dropdown.

---

<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 8, 2025, 7:14pm UTC](https://forum.inductiveautomation.com/t/dropdown-pre-select/104837/6 "2025-04-08T19:14:49Z")

</div>

> [@pascal.fragnoud](#):
>
> I like having an input parameter, binding the dropdown to it, then an output parameter, bound to the dropdown.

Just wondering, what's the difference between that and making the parameter an Input/Output?

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [April 8, 2025, 7:33pm UTC](https://forum.inductiveautomation.com/t/dropdown-pre-select/104837/7 "2025-04-08T19:33:22Z")

</div>

You can process the input before displaying it, which you can't do with a bidirectional binding.  
And you can restore the initial value with a simple `refreshBinding`.  
It also allows for a comparison between input and output, so you can for example extract only the ones that changed. Can be useful if you need to write them somewhere, you don't have to write the whole thing.

---

<div class="post-metadata">

**Author:** ![pick](https://avatars.discourse-cdn.com/v4/letter/p/9de0a6/32.png) [@pick](https://forum.inductiveautomation.com/u/pick)\
**Post date:** [April 9, 2025, 6:53am UTC](https://forum.inductiveautomation.com/t/dropdown-pre-select/104837/8 "2025-04-09T06:53:16Z")

</div>

Thank you very much Transistor, Pascal I keep in mind your suggestion thank you too.
