# Setting Logic Variable by HomeyScript

**URL:** <https://community.homey.app/t/setting-logic-variable-by-homeyscript/14819>\
**Category:** Questions & Help\
**Created:** [June 25, 2019, 3:11pm UTC](https://community.homey.app/t/setting-logic-variable-by-homeyscript/14819 "2019-06-25T15:11:16Z")\
**Posts on this page:** 1\
**Showing post:** 27

<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:45pm UTC](https://community.homey.app/t/setting-logic-variable-by-homeyscript/14819/27 "2019-07-01T19:45:39Z")

</div>

> [@JPe4619](#):
>
> the code:  
> `let allTokens = await Homey.flow.getTokens();`  
> Also get the same error:

After digging into the Homey developer API, Ive finally discovered the right syntax to get the tokens (which contain the Better Logic variables)!  
It should be:  
`let allTokens = await Homey.flowToken.getFlowTokens();`  
Apparently Athom changed the syntax. So if anyone stumbles on the same problem, this is the code to use.

---

_[View the full topic](https://community.homey.app/t/setting-logic-variable-by-homeyscript/14819)._
