# JSON.parse() doesn't work in JS column?

**URL:** <https://community.glideapps.com/t/json-parse-doesnt-work-in-js-column/43455>\
**Category:** Ask for Help\
**Created:** [June 24, 2022, 11:02am UTC](https://community.glideapps.com/t/json-parse-doesnt-work-in-js-column/43455 "2022-06-24T11:02:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![11183](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/11183/32/29797_2.png) [@11183](https://community.glideapps.com/u/11183)\
**Post date:** [June 24, 2022, 11:02am UTC](https://community.glideapps.com/t/json-parse-doesnt-work-in-js-column/43455/1 "2022-06-24T11:02:26Z")

</div>

I’m trying to get an array of values from an array of objects, looking like this:

`[{"1":"a"; "2":"b"}, {"1":"c"; "2":"d"}, {"1":"e"; "2":"f"}]`

My function looks like this:

```auto
var vals=[];
for(var i=0;i<testArray.length;i++){
   vals.push(testArray[i].val);
}

```

So my array is a string, got to a Text column from external API. And that’s why I decided to use JSON.parse() first in the JS column, but it doesn’t work.

Any advices from JS masters? Thank you in advance)

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [June 24, 2022, 11:28am UTC](https://community.glideapps.com/t/json-parse-doesnt-work-in-js-column/43455/2 "2022-06-24T11:28:03Z")

</div>

The JS column doesn’t accept arrays as parameters. If you’re passing a value that you want to be treated as an array, then the first part of your code needs to coerce it into an array using split or similar.

---

<div class="post-metadata">

**Author:** ![11183](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/11183/32/29797_2.png) [@11183](https://community.glideapps.com/u/11183)\
**Post date:** [June 24, 2022, 2:40pm UTC](https://community.glideapps.com/t/json-parse-doesnt-work-in-js-column/43455/3 "2022-06-24T14:40:40Z")

</div>

Now that makes sense, thank you!  
BTW I thought I could achieve this with Transform Array column. That’ll be even more simple I think.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [June 25, 2022, 2:41pm UTC](https://community.glideapps.com/t/json-parse-doesnt-work-in-js-column/43455/4 "2022-06-25T14:41:24Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
