# Option list do not work as expected

**URL:** <https://forum.electra.one/t/option-list-do-not-work-as-expected/3738>\
**Category:** Bug reports\
**Created:** [June 7, 2025, 8:48am UTC](https://forum.electra.one/t/option-list-do-not-work-as-expected/3738 "2025-06-07T08:48:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Electrolove](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.electra.one/electrolove/32/2440_2.png) [@Electrolove](https://forum.electra.one/u/Electrolove)\
**Post date:** [June 7, 2025, 8:48am UTC](https://forum.electra.one/t/option-list-do-not-work-as-expected/3738/1 "2025-06-07T08:48:58Z")

</div>

Martin, I feel like I’ve found a bug. (It could also be incorrect use of LUA code.) Look at my pictures.

First I add two option lists.

 ![Screenshot 2025-06-07 at 10.36.14](https://europe1.discourse-cdn.com/flex017/uploads/electraone/original/2X/f/fb5122a5c1e872f8b35b165e52e7b3c5e687acd4.png)

The result in Electra display is like this.

 ![IMG_6721](https://europe1.discourse-cdn.com/flex017/uploads/electraone/original/2X/c/c7cf341224fae355bc59e9f041080126813a4b69.jpeg)

That is correct. Option list called ‘FUNCTION’ has three values as it should. LUA code also added a name and a overlay the to second option list.

Then I add another option list.

 ![Screenshot 2025-06-07 at 10.36.58](https://europe1.discourse-cdn.com/flex017/uploads/electraone/original/2X/a/abb799265f8a33c0585c0243a5ea7763f208bd99.png)

The result in Electra display is like this.

 ![IMG_6722](https://europe1.discourse-cdn.com/flex017/uploads/electraone/original/2X/e/ef76e43e517c72646b468d1248c9daa83733c65d.jpeg)

That is correct. Option list called ‘FUNCTION’ still has three values.

If I move the option list to be first.

 ![Screenshot 2025-06-07 at 10.37.35](https://europe1.discourse-cdn.com/flex017/uploads/electraone/original/2X/e/ef73064b312c8c8f9ec3cbf98dfc5d517143c0cf.png)

The result in Electra display is like this.

 ![IMG_6723](https://europe1.discourse-cdn.com/flex017/uploads/electraone/original/2X/a/a02fd26d0157a7f2e3ec7a429512cf63d9bb0fc5.jpeg)

This is NOT correct. Look at the option list called ‘FUNCTION’, it has now four values. it should have three.

I also have some LUA code.

> – define values and labels  
> local lists = {
> 
> ```
> noise = {
> { value = 0, label = "High" },
> { value = 1, label = "Low" },
> { value = 2, label = "Peak" },
> { value = 3, label = "Decin" }
> },
> 
> vpn = {
> { value = 0, label = "Sin1" },
> { value = 1, label = "Sin2" },
> { value = 2, label = "Sin3" },
> { value = 3, label = "Sin4" },
> { value = 4, label = "Saw1" },
> { value = 5, label = "Saw2" },
> { value = 6, label = "Sqr1" },
> { value = 7, label = "Sqr2" },
> { value = 8, label = "Fat1" },
> { value = 9, label = "Fat2" },
> { value = 10, label = "Air1" },
> { value = 11, label = "Air2" },
> { value = 12, label = "Decay1" },
> { value = 13, label = "Decay2" },
> { value = 14, label = "Creep" },
> { value = 15, label = "Throdt" }
> },
> 
> user = {
> { value = 0, label = "Waves" },
> { value = 1, label = "User2" },
> { value = 2, label = "User3" },
> { value = 3, label = "User4" },
> { value = 4, label = "User5" },
> { value = 5, label = "User6" },
> { value = 6, label = "User7" },
> { value = 7, label = "User8" },
> { value = 8, label = "User9" },
> { value = 9, label = "User10" },
> { value = 10, label = "User11" },
> { value = 11, label = "User12" },
> { value = 12, label = "User13" },
> { value = 13, label = "User14" },
> { value = 14, label = "User15" },
> { value = 15, label = "User16" }
> }
> 
> ```
> 
> }
> 
> – create overlays  
> overlays.create(2, lists.noise)  
> overlays.create(3, lists.vpn)  
> overlays.create(4, lists.user)
> 
> function set\_function(valueObject, value)  
> – your code goes here  
> if value == 0 then  
> controls.get(2):setName(“NOISE”)  
> – set overlay  
> controls.get(2):getValue():setOverlayId(2)  
> end
> 
> ```
> if value == 1 then
> controls.get(2):setName("VPN")
> -- set overlay
> controls.get(2):getValue():setOverlayId(3)
> end
> 
> if value == 2 then
> controls.get(2):setName("USER")
> -- set overlay
> controls.get(2):getValue():setOverlayId(4)
> end
> 
> ```
> 
> end

UPDATE: I just discovered that it’s only the option list (if I put it above the rest) that causes the error.

This works:

 ![Screenshot 2025-06-07 at 14.00.35](https://europe1.discourse-cdn.com/flex017/uploads/electraone/original/2X/3/30bbfdcf4c582941dc3334ac1221ab3ee00eebf1.png)

Not this:

 ![Screenshot 2025-06-07 at 14.00.24](https://europe1.discourse-cdn.com/flex017/uploads/electraone/original/2X/5/5468ebed93e496bbb1e44873b42c49d80497a33c.png)

---

<div class="post-metadata">

**Author:** ![martin](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.electra.one/martin/32/145_2.png) [@martin](https://forum.electra.one/u/martin)\
**Post date:** [June 8, 2025, 2:08pm UTC](https://forum.electra.one/t/option-list-do-not-work-as-expected/3738/2 "2025-06-08T14:08:49Z")

</div>

would it be possible to share (PM) a link to the preset. It would make it easier for me to see the issue.

---

<div class="post-metadata">

**Author:** ![Electrolove](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.electra.one/electrolove/32/2440_2.png) [@Electrolove](https://forum.electra.one/u/Electrolove)\
**Post date:** [June 8, 2025, 2:13pm UTC](https://forum.electra.one/t/option-list-do-not-work-as-expected/3738/3 "2025-06-08T14:13:59Z")

</div>

I have sent you the link.

---

<div class="post-metadata">

**Author:** ![martin](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.electra.one/martin/32/145_2.png) [@martin](https://forum.electra.one/u/martin)\
**Post date:** [June 10, 2025, 3:16pm UTC](https://forum.electra.one/t/option-list-do-not-work-as-expected/3738/4 "2025-06-10T15:16:54Z")

</div>

You create an overlay in Lua that as the same id as another overlay define in JSON. If you use unique (unused) id, it should work fine.

I will adjust the `overlays.create()` function to create overlays to report the conflict.

---

<div class="post-metadata">

**Author:** ![Electrolove](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.electra.one/electrolove/32/2440_2.png) [@Electrolove](https://forum.electra.one/u/Electrolove)\
**Post date:** [June 10, 2025, 4:48pm UTC](https://forum.electra.one/t/option-list-do-not-work-as-expected/3738/5 "2025-06-10T16:48:43Z")

</div>

Thanks Martin, I almost realized I had made a mistake. I’ll test it now.
