# Formatting JSON

**URL:** <https://community.glideapps.com/t/formatting-json/81669>\
**Category:** Ask for Help\
**Created:** [May 2, 2025, 2:30pm UTC](https://community.glideapps.com/t/formatting-json/81669 "2025-05-02T14:30:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrew\_Davies](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/andrew_davies/32/41838_2.png) [@Andrew\_Davies](https://community.glideapps.com/u/Andrew_Davies)\
**Post date:** [May 2, 2025, 2:30pm UTC](https://community.glideapps.com/t/formatting-json/81669/1 "2025-05-02T14:30:03Z")

</div>

Hello all

I have two text columns (which are populated from a multi choice component.

Tag - could be “Tag 1, Tag 2, Tag 3” (or could be empty)  
Location - could be "Location 1, Location 2) - or again empty.

I need to get that into JSON like below

{  
“filters”: {  
“tags”: [“Tag 1”, “Tag 2”],  
“location”: [“Location 1”, “Location 2”]  
}  
}

I know that’s possible, and am sure I have done it before - but what’s the best way?

Is JavaScript column a good bet, or can I use JSON Object / Template?

Thanks,  
Andrew

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [May 2, 2025, 2:36pm UTC](https://community.glideapps.com/t/formatting-json/81669/2 "2025-05-02T14:36:00Z")

</div>

I would use Split Text columns to create an array for tags and location, and then use a JSON Object columns to build the JSON.

---

<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:** [May 2, 2025, 2:41pm UTC](https://community.glideapps.com/t/formatting-json/81669/3 "2025-05-02T14:41:09Z")

</div>

Jeff beat me to it, but yes - split text then JSON. Only difference is I would suggest a JSON Template column, like so:

 ![CleanShot 2025-05-02 at 22.40.21@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/5/d573054971ce7515d0801726450349f7ac82b67c.png)

```auto
{
  "filters": {
    "tags": [$tags],
    "location": [$locations]
  }
}

```

Resultant JSON:

```auto
{
  "filters": {
    "tags": [
      "Tag 1",
      "Tag 2",
      "Tag 3"
    ],
    "location": [
      "Location 1",
      "Location 2"
    ]
  }
}

```

---

<div class="post-metadata">

**Author:** ![Andrew\_Davies](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/andrew_davies/32/41838_2.png) [@Andrew\_Davies](https://community.glideapps.com/u/Andrew_Davies)\
**Post date:** [May 2, 2025, 2:47pm UTC](https://community.glideapps.com/t/formatting-json/81669/4 "2025-05-02T14:47:27Z")

</div>

Got it thanks - only slight difference for me is that that finished JSON then gets fed into another final JSON Object column - so in my template I did

{“tags”:[$tags],“location”:[$location]}

(ie - left the filter key off, as that is then added in by my “final” JSON object column)

Thanks both! Knew you would know!

Andrew

---

<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:** [May 9, 2025, 2:47pm UTC](https://community.glideapps.com/t/formatting-json/81669/5 "2025-05-09T14:47:42Z")

</div>

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