# setOverlayId(), getOverlayId() bug

**URL:** <https://forum.electra.one/t/setoverlayid-getoverlayid-bug/2630>\
**Category:** Bug reports\
**Created:** [January 8, 2024, 9:05pm UTC](https://forum.electra.one/t/setoverlayid-getoverlayid-bug/2630 "2024-01-08T21:05:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![oldgearguy](https://avatars.discourse-cdn.com/v4/letter/o/f4b2a3/32.png) [@oldgearguy](https://forum.electra.one/u/oldgearguy)\
**Post date:** [January 8, 2024, 9:05pm UTC](https://forum.electra.one/t/setoverlayid-getoverlayid-bug/2630/1 "2024-01-08T21:05:33Z")

</div>

Running 3.5 on a mk II.

It appears that the set/get overlayId stuff is broken. (Unless my syntax is not correct)

I can set it using:

```auto
         i = 99
         val = controls.get(ctlId):getValue("value")
         val:setOverlayId(i)

```

but when I try to read it using code similar to:

```auto
         val = controls.get(ctlId):getValue("value")
         j = val:getOverlayId()

```

the value always comes back 0

---

<div class="post-metadata">

**Author:** ![oldgearguy](https://avatars.discourse-cdn.com/v4/letter/o/f4b2a3/32.png) [@oldgearguy](https://forum.electra.one/u/oldgearguy)\
**Post date:** [January 9, 2024, 7:22pm UTC](https://forum.electra.one/t/setoverlayid-getoverlayid-bug/2630/2 "2024-01-09T19:22:29Z")

</div>

This can be a lower priority – I rewrote the PCM 80 template to not use the overlayId field in the control/value.

Not fully debugged the change, but 90% looks good so far.

---

<div class="post-metadata">

**Author:** ![busa](https://avatars.discourse-cdn.com/v4/letter/b/d78d45/32.png) [@busa](https://forum.electra.one/u/busa)\
**Post date:** [February 4, 2024, 7:28pm UTC](https://forum.electra.one/t/setoverlayid-getoverlayid-bug/2630/3 "2024-02-04T19:28:07Z")

</div>

Seams as the whole Overlay is buggy. also the **overlays.get (overlayId)** command does not return a valid Overlay-Object.

---

<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:** [February 6, 2024, 5:21pm UTC](https://forum.electra.one/t/setoverlayid-getoverlayid-bug/2630/4 "2024-02-06T17:21:09Z")

</div>

> [@oldgearguy](#):
>
> I can set it using:
> 
> ```auto
> i = 99
> val = controls.get(ctlId):getValue("value")
> val:setOverlayId(i)
> 
> ```
> 
> but when I try to read it using code similar to:
> 
> ```auto
> val = controls.get(ctlId):getValue("value")
> j = val:getOverlayId()
> 
> ```
> 
> the value always comes back 0

@oldgearguy I really have hard time to reply to that one 🙂 I reviewed both calls, `set` and `get`. It works as expected 🙂

Here’s a preset inspired by your code: [Electra One App](https://app.electra.one/preset/41rmk23xJBYqPdoVabKL)

> also the **overlays.get (overlayId)** command does not return a valid Overlay-Object.

This is correct though. Just fixed it in the development version of the firmware.
