# How to read and Set the logic variables with HomeyScript?

**URL:** <https://community.homey.app/t/how-to-read-and-set-the-logic-variables-with-homeyscript/14520>\
**Category:** Apps\
**Created:** [June 17, 2019, 2:04pm UTC](https://community.homey.app/t/how-to-read-and-set-the-logic-variables-with-homeyscript/14520 "2019-06-17T14:04:56Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![dsdevries](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dsdevries/32/80220_2.png) [@dsdevries](https://community.homey.app/u/dsdevries)\
**Post date:** [June 7, 2024, 2:00pm UTC](https://community.homey.app/t/how-to-read-and-set-the-logic-variables-with-homeyscript/14520/7 "2024-06-07T14:00:22Z")

</div>

you really don’t need lodash to convert an object into an array so you can find a variable by a field property. you can just write:

```auto
const myVar = Object.values(await Homey.logic.getVariables()).find(({name}) => name === "Variable name");

```

---

_[View the full topic](https://community.homey.app/t/how-to-read-and-set-the-logic-variables-with-homeyscript/14520)._
