# Payload variable in function

**URL:** <https://forums.losant.com/t/payload-variable-in-function/1707>\
**Category:** Help\
**Tags:** function-node\
**Created:** [April 10, 2019, 3:20pm UTC](https://forums.losant.com/t/payload-variable-in-function/1707 "2019-04-10T15:20:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lars\_Andersson](https://avatars.discourse-cdn.com/v4/letter/l/f05b48/32.png) [@Lars\_Andersson](https://forums.losant.com/u/Lars_Andersson)\
**Post date:** [April 10, 2019, 3:20pm UTC](https://forums.losant.com/t/payload-variable-in-function/1707/1 "2019-04-10T15:20:54Z")

</div>

I’m trying to use payload variable payload.data.[01\_Status]  
as below, but it doesn;t like the square brackets.  
I have tried without them but it doesn’t like that either.

payload.data.state\_bits = intToUint(payload.data.[01\_Status],16).toString(2).split("").join("");

---

<div class="post-metadata">

**Author:** ![anaptfox](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/anaptfox/32/873_2.png) [@anaptfox](https://forums.losant.com/u/anaptfox)\
**Post date:** [April 10, 2019, 3:26pm UTC](https://forums.losant.com/t/payload-variable-in-function/1707/2 "2019-04-10T15:26:56Z")

</div>

Is `01_Status` a variable? If not, that should be referenced like this:

`payload.data["01_Status"]`

The dot before the brackets is only required in the templates. In the function node, you follow [Javascript Rules](https://javascript.info/object#square-brackets).

---

<div class="post-metadata">

**Author:** ![Lars\_Andersson](https://avatars.discourse-cdn.com/v4/letter/l/f05b48/32.png) [@Lars\_Andersson](https://forums.losant.com/u/Lars_Andersson)\
**Post date:** [April 10, 2019, 3:31pm UTC](https://forums.losant.com/t/payload-variable-in-function/1707/3 "2019-04-10T15:31:31Z")

</div>

That was it, thanks. I forgot about that.  
I got the variable by copying the path in the debug screen and it didn’t contain the quotations inside.
