# How I can change a global variable or “tag” inside HomeyScript?

**URL:** <https://community.homey.app/t/how-i-can-change-a-global-variable-or-tag-inside-homeyscript/15008>\
**Category:** Questions & Help\
**Created:** [July 1, 2019, 7:58am UTC](https://community.homey.app/t/how-i-can-change-a-global-variable-or-tag-inside-homeyscript/15008 "2019-07-01T07:58:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Satoer](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/satoer/32/38113_2.png) [@Satoer](https://community.homey.app/u/Satoer)\
**Post date:** [July 1, 2019, 7:58am UTC](https://community.homey.app/t/how-i-can-change-a-global-variable-or-tag-inside-homeyscript/15008/1 "2019-07-01T07:58:52Z")

</div>

Can someone supply me with an example code how I can change a global variable or “tag” inside HomeyScript? I’m trying to change these tags:

 ![homey-tags](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/8/8dd5de16b5c868803fe1f3df5fc034bb1ac9adf3.png)  
I’ve managed to read the variables:  
 ![HomeyScript-GlobalVariable](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/f/f1645f0a32f08d85af80e0c22b01cb4ae4884934.png)  
But I have no clue how to change them inside HomeyScript, as you can see from the console window, the value does not get updated. I’ve seen several posts about it, but all the scripts doesn’t seem to work or the thread is abandoned.  
`Homey.logic.updateVariable({id: Logic.id, variable: {'value' : 'TEST!'}})`

Doesn’t seem to work… but maybe I have mistaken the syntax. Anyone can provide me a working syntax?

---

<div class="post-metadata">

**Author:** ![Rocodamelshekima](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rocodamelshekima/32/8209_2.png) [@Rocodamelshekima](https://community.homey.app/u/Rocodamelshekima)\
**Post date:** [July 1, 2019, 3:01pm UTC](https://community.homey.app/t/how-i-can-change-a-global-variable-or-tag-inside-homeyscript/15008/2 "2019-07-01T15:01:36Z")

</div>

Split this topic on July 1, 2019, 3:01pm UTC

22 posts were merged into an existing topic: [Setting Logic Variable by HomeyScript](https://community.homey.app/t/setting-logic-variable-by-homeyscript/14819)

---

<div class="post-metadata">

**Author:** ![Rocodamelshekima](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rocodamelshekima/32/8209_2.png) [@Rocodamelshekima](https://community.homey.app/u/Rocodamelshekima)\
**Post date:** [July 1, 2019, 2:19pm UTC](https://community.homey.app/t/how-i-can-change-a-global-variable-or-tag-inside-homeyscript/15008/23 "2019-07-01T14:19:38Z")

</div>

Closed on July 1, 2019, 2:19pm UTC


