# Remove 'global' variables and remove 'tag'

**URL:** <https://community.homey.app/t/remove-global-variables-and-remove-tag/69348>\
**Category:** Questions & Help\
**Tags:** homeyscript\
**Created:** [September 24, 2022, 5:19am UTC](https://community.homey.app/t/remove-global-variables-and-remove-tag/69348 "2022-09-24T05:19:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![opstad](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/opstad/32/49391_2.png) [@opstad](https://community.homey.app/u/opstad)\
**Post date:** [September 24, 2022, 5:19am UTC](https://community.homey.app/t/remove-global-variables-and-remove-tag/69348/1 "2022-09-24T05:19:18Z")

</div>

The global.set/get is very useful, but is there a global.delete function? I have some global values I don’t need anymore.

The same goes for tag. Can i remove tags that I don’t use anymore?

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [September 24, 2022, 6:16am UTC](https://community.homey.app/t/remove-global-variables-and-remove-tag/69348/2 "2022-09-24T06:16:47Z")

</div>

It looks like this may delete a value:

```auto
global.set('name', undefined)

```

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [September 24, 2022, 2:00pm UTC](https://community.homey.app/t/remove-global-variables-and-remove-tag/69348/3 "2022-09-24T14:00:44Z")

</div>

For tag removal:

 ![Screenshot_20220924-160014_Chrome](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/7/7/7753f2e4dd0076f11411c89da589eae0f73b0ead.jpeg)

---

<div class="post-metadata">

**Author:** ![Marcel\_Kouwenberg](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marcel_kouwenberg/32/47966_2.png) [@Marcel\_Kouwenberg](https://community.homey.app/u/Marcel_Kouwenberg)\
**Post date:** [November 19, 2022, 12:02pm UTC](https://community.homey.app/t/remove-global-variables-and-remove-tag/69348/4 "2022-11-19T12:02:52Z")

</div>

This will work, but if by mistake komma’s are in the name this function will not work anymore.  
Is there another way to get these tags from the system ?

I have names like [Kitchen Light, false, true, value]

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [November 19, 2022, 4:29pm UTC](https://community.homey.app/t/remove-global-variables-and-remove-tag/69348/5 "2022-11-19T16:29:27Z")

</div>

This works fine:

```auto
// Create Tag
log('Creating tag Kitchen Light, false, true, value ...');
await tag('Kitchen Light, false, true, value', 'SomeNewValue');
await tag('[Kitchen Light, false, true, value]', 'SomeNewValue');

// Wait 10s
for (let i = 0; i < 2; i++) {
  log('.');
  await wait(1000); // in milliseconds
}

// Delete Tag
log('Deleting tag [Kitchen Light, false, true, value] ...');
await tag('Kitchen Light, false, true, value', null);
await tag('[Kitchen Light, false, true, value]', null);

```
