# Issue with Homey.logic.updateVariable: "Missing Parameter: variable"

**URL:** <https://community.homey.app/t/issue-with-homey-logic-updatevariable-missing-parameter-variable/132693>\
**Category:** Flows\
**Created:** [March 13, 2025, 7:32pm UTC](https://community.homey.app/t/issue-with-homey-logic-updatevariable-missing-parameter-variable/132693 "2025-03-13T19:32:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrea\_Boletti](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/andrea_boletti/32/113997_2.png) [@Andrea\_Boletti](https://community.homey.app/u/Andrea_Boletti)\
**Post date:** [March 13, 2025, 7:32pm UTC](https://community.homey.app/t/issue-with-homey-logic-updatevariable-missing-parameter-variable/132693/1 "2025-03-13T19:32:58Z")

</div>

Hi everyone, I’m encountering an issue with the `Homey.logic.updateVariable` function in my Homey script. I’m trying to update a logic variable named `conteggio_eventi`. The variable is successfully retrieved with the following ID: `8bed27e2-2905-430b-91fe-36ca4d37d0a1`.

Here’s what I’ve done so far:

1. I successfully fetch logic variables using `Homey.logic.getVariables()`.
2. I confirm the variable’s ID and value.
3. I call `Homey.logic.updateVariable` using the following formats:

- `{ id: '8bed27e2-2905-430b-91fe-36ca4d37d0a1', value: 1 }`
- `{ variable: { id: '8bed27e2-2905-430b-91fe-36ca4d37d0a1', value: 1 } }`

In both cases, I get the error: **“Missing Parameter: variable”**.

Here’s the output from the logs:

Attempting to update the “conteggio\_eventi” variable  
Object passed to updateVariable: { variable: { id: ‘8bed27e2-2905-430b-91fe-36ca4d37d0a1’, value: 1 } }  
UpdateVariable: Error - Missing Parameter: variable

I’m unsure what parameter might be missing or if I’m using the wrong format. Has anyone had experience with this function and can help me resolve the issue?

Thank you in advance!  
Ciao, Andrea

---

<div class="post-metadata">

**Author:** ![Rmb](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rmb/32/79135_2.png) [@Rmb](https://community.homey.app/u/Rmb)\
**Post date:** [March 13, 2025, 8:02pm UTC](https://community.homey.app/t/issue-with-homey-logic-updatevariable-missing-parameter-variable/132693/2 "2025-03-13T20:02:21Z")

</div>

You seem to use a different syntax:

`Homey.logic.updateVariable({id: TodaysDateId, variable: {'value' : dateNum}} )`

> [@Set Logic variable by NAME?](https://community.homey.app/t/set-logic-variable-by-name/117888/5):
>
> Hi again, thanks for all input. Here is my current script: let testDay = new Date(); let dateNum = testDay.getDate(); let monthTxtShort = testDay.toLocaleString('fefault', { month: 'short'}) let TodaysDate = Object.values(await Homey.logic.getVariables()).find(({name}) =\> name === "TodaysDate"); let TodaysDateId = TodaysDate.id let MonthTextShort = Object.values(await Homey.logic.getVariables()).find(({name}) =\> name === "MonthTextShort"); let MonthTextShortId = MonthTextShort.id Homey.logic…

---

<div class="post-metadata">

**Author:** ![Andrea\_Boletti](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/andrea_boletti/32/113997_2.png) [@Andrea\_Boletti](https://community.homey.app/u/Andrea_Boletti)\
**Post date:** [March 14, 2025, 1:29pm UTC](https://community.homey.app/t/issue-with-homey-logic-updatevariable-missing-parameter-variable/132693/3 "2025-03-14T13:29:04Z")

</div>

THANK YOU! the script works now!
