# Calling a lua function from the Function control input

**URL:** <https://forum.electra.one/t/calling-a-lua-function-from-the-function-control-input/2964>\
**Category:** General discussion\
**Created:** [May 29, 2024, 1:03am UTC](https://forum.electra.one/t/calling-a-lua-function-from-the-function-control-input/2964 "2024-05-29T01:03:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rkram53](https://avatars.discourse-cdn.com/v4/letter/r/e495f1/32.png) [@rkram53](https://forum.electra.one/u/rkram53)\
**Post date:** [May 29, 2024, 1:03am UTC](https://forum.electra.one/t/calling-a-lua-function-from-the-function-control-input/2964/1 "2024-05-29T01:03:00Z")

</div>

Trying to work this through on my new Elecrtra One. Can someone please help me here. Let’s say I have a lua function xyz(valueObject, value).  
I assume I can attach the function to my desired Selected Control in the GUI tool using the FUNCTION line? But I’m not sure how the input parameters get sent for the Selected Control I’m configuring. Are (valueObject, value) just defaulted if I just enter xyz for the function? Or maybe I don’t use the FUNCTION line and define all the objects in the lua code and trigger it all from there? Thanks.  
 ![image](https://europe1.discourse-cdn.com/flex017/uploads/electraone/original/2X/a/a498000c06716c15dd5e80d0cff645a6a2dbad53.png)

---

<div class="post-metadata">

**Author:** ![Phommed](https://avatars.discourse-cdn.com/v4/letter/p/ce73a5/32.png) [@Phommed](https://forum.electra.one/u/Phommed)\
**Post date:** [May 29, 2024, 7:39am UTC](https://forum.electra.one/t/calling-a-lua-function-from-the-function-control-input/2964/2 "2024-05-29T07:39:27Z")

</div>

Hi, yes the E1 documentation calls these “Value function callbacks”. See [Preset Lua extension | Electra One Documentation](https://docs.electra.one/developers/luaext.html#value-function-callbacks). The (valueObject, value) arguments are injected by the Preset Lua extension when your “xyz” function callback is called if and when the control value changes (e.g you have turned the related pot).

The valueObject parameter is one of these guys: [Preset Lua extension | Electra One Documentation](https://docs.electra.one/developers/luaext.html#value)

---

<div class="post-metadata">

**Author:** ![rkram53](https://avatars.discourse-cdn.com/v4/letter/r/e495f1/32.png) [@rkram53](https://forum.electra.one/u/rkram53)\
**Post date:** [May 29, 2024, 7:53am UTC](https://forum.electra.one/t/calling-a-lua-function-from-the-function-control-input/2964/3 "2024-05-29T07:53:04Z")

</div>

I thought it was something like that. Could not find it in the docs I was looking at. Thanks for the references!
