# Retaining the options of select list after reopening of editor

**URL:** <https://discourse.nodered.org/t/retaining-the-options-of-select-list-after-reopening-of-editor/73524>\
**Category:** Developing Nodes\
**Created:** [11 January 2023 10:20 UTC](https://discourse.nodered.org/t/retaining-the-options-of-select-list-after-reopening-of-editor/73524 "2023-01-11T10:20:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![syedhannan](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/syedhannan/32/72932_2.png) [@syedhannan](https://discourse.nodered.org/u/syedhannan)\
**Post date:** [11 January 2023 10:20 UTC](https://discourse.nodered.org/t/retaining-the-options-of-select-list-after-reopening-of-editor/73524/1 "2023-01-11T10:20:54Z")

</div>

In my custom node editor I am fetching a list of files from FTP server and using typedInput select tag for displaying the same.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/a/baae362aa42a0ec5a86c29997c83a5a1bac982a3.png)

Once I select a value and then close the editor and then reopen it then I don't get the same list as before but now it is just as a string.

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/a/fa482af48868ab09e743f8a15dd7aa0cc98cad2c.png)

I am not sure where I am going wrong. Is it because I am fetching the values in oneditprepare?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [11 January 2023 10:24 UTC](https://discourse.nodered.org/t/retaining-the-options-of-select-list-after-reopening-of-editor/73524/2 "2023-01-11T10:24:30Z")

</div>

> [@syedhannan](#):
>
> Is it because I am fetching the values in oneditprepare?

Probably, but is impossible to say without more detail & without seeing code.

Do you get an error in browser console?

Try adding `debugger` statements in your `oneditprepare` function (at appropriate points) and debug-step the code to see what is happening.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [11 January 2023 10:58 UTC](https://discourse.nodered.org/t/retaining-the-options-of-select-list-after-reopening-of-editor/73524/3 "2023-01-11T10:58:17Z")

</div>

> [@Steve-Mcl](#):
>
> Try adding `debugger` statements in your `oneditprepare` function (at appropriate points) and debug-step the code to see what is happening.

Or simply use `console.log` and open the browser dev tools.

---

<div class="post-metadata">

**Author:** ![syedhannan](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/syedhannan/32/72932_2.png) [@syedhannan](https://discourse.nodered.org/u/syedhannan)\
**Post date:** [11 January 2023 10:58 UTC](https://discourse.nodered.org/t/retaining-the-options-of-select-list-after-reopening-of-editor/73524/4 "2023-01-11T10:58:42Z")

</div>

There are no errors shown in the browser console

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [11 January 2023 10:59 UTC](https://discourse.nodered.org/t/retaining-the-options-of-select-list-after-reopening-of-editor/73524/5 "2023-01-11T10:59:46Z")

</div>

There won't be an error, it is doing what you've told it too. Its just that isn't what you want it to do. `console.log` variables so that you can see what is happening.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [12 March 2023 10:59 UTC](https://discourse.nodered.org/t/retaining-the-options-of-select-list-after-reopening-of-editor/73524/6 "2023-03-12T10:59:58Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
