# Javascript runs in console but not in Glide column

**URL:** <https://community.glideapps.com/t/javascript-runs-in-console-but-not-in-glide-column/72049>\
**Category:** Ask for Help\
**Created:** [March 26, 2024, 11:15am UTC](https://community.glideapps.com/t/javascript-runs-in-console-but-not-in-glide-column/72049 "2024-03-26T11:15:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![heidikruger](https://avatars.discourse-cdn.com/v4/letter/h/c37758/32.png) [@heidikruger](https://community.glideapps.com/u/heidikruger)\
**Post date:** [March 26, 2024, 11:15am UTC](https://community.glideapps.com/t/javascript-runs-in-console-but-not-in-glide-column/72049/1 "2024-03-26T11:15:20Z")

</div>

I have the following javascript that I would like to run in a Glide table column but it does not return anything. When I run it in the browser console I do get the result that I want. Can anyone tell me what I am missing?

This is the code I am running in the console:

```auto
let p1 = "M9uEXlz-Rn6Cr2ZHLxNSIA, M9uEXlz-Rn6Cr2ZHLxNSIA, M9uEXlz-Rn6Cr2ZHLxNSIA, M9uEXlz-Rn6Cr2ZHLxNSIA, M9uEXlz-Rn6Cr2ZHLxNSIA, a-qNlSOI8RFS7hR7nUAZ4ww, a-qNlSOI8RFS7hR7nUAZ4ww, vv4CPGykQkK4BN8SsnLd9A, sUe8Ra2eSjyCG7jKZuTo1w, a-qNlSOI8RFS7hR7nUAZ4ww, a-qNlSOI8RFS7hR7nUAZ4ww, vv4CPGykQkK4BN8SsnLd9A, sUe8Ra2eSjyCG7jKZuTo1w";
let arr = p1.split(', ');
let counts = {};
arr.forEach(x => {
   counts[x] = (counts[x] || 0) + 1;
}); 
console.log(counts);

```

This is the output in the browser console:

```auto
{M9uEXlz-Rn6Cr2ZHLxNSIA: 5, a-qNlSOI8RFS7hR7nUAZ4ww: 4, vv4CPGykQkK4BN8SsnLd9A: 2, sUe8Ra2eSjyCG7jKZuTo1w: 2}

```

In the Glide table, my p1 parameter is a Joined List column with the values above. The javascript column looks like this:  
 ![Screenshot 2024-03-26 at 13.14.39](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/a/0/a008837c595eadfaf10a75181e92aa28ef0b87e7.png)

Thank you!

---

<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:** [March 26, 2024, 11:44am UTC](https://community.glideapps.com/t/javascript-runs-in-console-but-not-in-glide-column/72049/2 "2024-03-26T11:44:13Z")

</div>

The JavaScript column can only return strings, not objects. If you stringify counts before returning, it should work.

---

<div class="post-metadata">

**Author:** ![heidikruger](https://avatars.discourse-cdn.com/v4/letter/h/c37758/32.png) [@heidikruger](https://community.glideapps.com/u/heidikruger)\
**Post date:** [March 26, 2024, 12:02pm UTC](https://community.glideapps.com/t/javascript-runs-in-console-but-not-in-glide-column/72049/3 "2024-03-26T12:02:57Z")

</div>

Thank you!

---

<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:** [April 2, 2024, 12:03pm UTC](https://community.glideapps.com/t/javascript-runs-in-console-but-not-in-glide-column/72049/4 "2024-04-02T12:03:10Z")

</div>

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