# Not enough toys in function sandbox

**URL:** <https://forums.losant.com/t/not-enough-toys-in-function-sandbox/97>\
**Category:** Help\
**Created:** [April 14, 2016, 5:53am UTC](https://forums.losant.com/t/not-enough-toys-in-function-sandbox/97 "2016-04-14T05:53:39Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![boneskull](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/boneskull/32/92_2.png) [@boneskull](https://forums.losant.com/u/boneskull)\
**Post date:** [April 14, 2016, 5:53am UTC](https://forums.losant.com/t/not-enough-toys-in-function-sandbox/97/1 "2016-04-14T05:53:39Z")

</div>

I need to POST some HTTP data. The endpoint accepts only `application/x-www-form-urlencoded` content.

The documentation claims function nodes only allow “base javascript functionality”. The `encodeUriComponent()` [function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) is not available, yet it has been part of the spec since ES3.

So I have to write a function to do this _manually_, which is a real pain. Can you whitelist this function (and others like it)?

thanks  
Chris

---

<div class="post-metadata">

**Author:** ![boneskull](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/boneskull/32/92_2.png) [@boneskull](https://forums.losant.com/u/boneskull)\
**Post date:** [April 14, 2016, 5:54am UTC](https://forums.losant.com/t/not-enough-toys-in-function-sandbox/97/2 "2016-04-14T05:54:42Z")

</div>

I realize I may have typo’d it; let me try again. Can you provide a list of allowed functionality?

---

<div class="post-metadata">

**Author:** ![boneskull](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/boneskull/32/92_2.png) [@boneskull](https://forums.losant.com/u/boneskull)\
**Post date:** [April 14, 2016, 5:59am UTC](https://forums.losant.com/t/not-enough-toys-in-function-sandbox/97/3 "2016-04-14T05:59:12Z")

</div>

Nope; I apologize, must have typo’d. At any rate, would be happy if you considered making Lodash available–I think that’s pretty safe–but it’s a slippery slope.

---

<div class="post-metadata">

**Author:** ![Brandon\_Cannaday](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/brandon_cannaday/32/14_2.png) [@Brandon\_Cannaday](https://forums.losant.com/u/Brandon_Cannaday)\
**Post date:** [April 14, 2016, 2:26pm UTC](https://forums.losant.com/t/not-enough-toys-in-function-sandbox/97/4 "2016-04-14T14:26:46Z")

</div>

We’ve also considered bringing in some Lodash. I’ll create the issue and we’ll begin investigating.

---

<div class="post-metadata">

**Author:** ![Zachary\_Hirschtritt](https://avatars.discourse-cdn.com/v4/letter/z/7993a0/32.png) [@Zachary\_Hirschtritt](https://forums.losant.com/u/Zachary_Hirschtritt)\
**Post date:** [July 30, 2017, 2:57pm UTC](https://forums.losant.com/t/not-enough-toys-in-function-sandbox/97/5 "2017-07-30T14:57:54Z")

</div>

@Brandon_Cannaday

Sorry if this is the wrong thread to re-hash this issue! I was wondering if there is a list of allowed JS in the function block. I’m running into some weird limitations where I think I’m just using base js methods. Thanks!

---

<div class="post-metadata">

**Author:** ![Brandon\_Cannaday](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/brandon_cannaday/32/14_2.png) [@Brandon\_Cannaday](https://forums.losant.com/u/Brandon_Cannaday)\
**Post date:** [July 31, 2017, 2:38pm UTC](https://forums.losant.com/t/not-enough-toys-in-function-sandbox/97/6 "2017-07-31T14:38:15Z")

</div>

The function node supports most of the [standard built-in objects](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects) (things marked as experimental aren’t available). We’ve also whitelisted the [Buffer object](https://nodejs.org/dist/latest-v6.x/docs/api/buffer.html) for binary parsing.

---

<div class="post-metadata">

**Author:** ![Zachary\_Hirschtritt](https://avatars.discourse-cdn.com/v4/letter/z/7993a0/32.png) [@Zachary\_Hirschtritt](https://forums.losant.com/u/Zachary_Hirschtritt)\
**Post date:** [July 31, 2017, 11:29pm UTC](https://forums.losant.com/t/not-enough-toys-in-function-sandbox/97/7 "2017-07-31T23:29:09Z")

</div>

Got it! The debug terminal was (annoyingly) automatically displaying my date string “20170731” as a date object as the output. When I emailed that same value to myself, it appeared as intended, the simple string of numbers.

I assumed it was the JS block was doing something bizarre, but it was actually working fine. Thank you!

---

<div class="post-metadata">

**Author:** ![Brandon\_Cannaday](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/brandon_cannaday/32/14_2.png) [@Brandon\_Cannaday](https://forums.losant.com/u/Brandon_Cannaday)\
**Post date:** [August 1, 2017, 2:57pm UTC](https://forums.losant.com/t/not-enough-toys-in-function-sandbox/97/8 "2017-08-01T14:57:09Z")

</div>

The debug output can sometimes be misleading, especially for Date objects. Date objects are automatically displayed as localized strings (based on the browser’s timezone). We thought this would be slightly more useful than just something like “Date Object”. However, this isn’t the first time someone has been confused by date output in Debug tab. Definitely worth some thought on our side to see if there’s a way to make it more clear. If you haven’t suggestions, would love to hear them!
