TIP: How to parse JSON with native Bubble (no ext plugins)

Hi all, I just wanted to pop in and share a quick tip.

Understanding how parse to JSON in Bubble is something that comes up quite a bit, so I wanted to share a very simple, easy to follow method on how to do that – only using vanilla Bubble.

I’ve created a Landing Page + Editor Links so you can look around and see how it works.
Once you’ve opened the editor, you will be able to view debug mode to inspect the data sources.

:right_arrow: VIEW THE LANDING PAGE :desktop_computer:

:right_arrow: PEEK AT THE EDITOR :eyes:

This is interactive so take a look around!
I hope this helps someone who may be struggling with this concept in Bubble.

There are other ways to accomplish this sort of thing, this is just a very simple way to get your build going. So, give it a try and let me know.

Shoutout to Bubble AI Agent for the landing page and and data structure, I was able to put this demo app together really quickly and just focus on the JSON/API steps.

14 Likes

Why hasn’t Bubble just built this in already?

Feels like it could be a quick weekend project…hit “add Parse JSON button,” call it a day. :sweat_smile:

8 Likes

:parsed as JSON

6 Likes

:formatted as JSON

4 Likes

Should be :json formatted as type and we need a way to add custom type without using API connector. Same in plugin editor.

7 Likes

I found this, spam the upvote so I can spam the company slack :joy:: JSON parser from the expression editor

7 Likes

I wonder if the new API connector tab rebuild could have a dedicated JSON API types section :thinking:

1 Like

To separate the API objects created? Right now, I separate them by creating an API I call, My Data Structures, then every call in it is the API object.

1 Like

The problem with using API objects is that the data doesn’t show up properly in the database. I don’t care about “code export” at all but a database needs to have all the information plainly available (e.g., for quick checks, external analytics, processing, etc.).

In the meantime you can link them these posts:

https://forum.bubble.io/t/can-t-parse-nested-json-from-openai-how-is-this-still-a-thing-in-2025

2 Likes

Yea exactly @boston85719 - this is purely to get the functionality from the expression editor right (amongst other things)?

They could have in the new API tab (wishlist i know :wink: ) :

  • Define JSON types section (as you do with ‘My Data Structures’)
  • A more native/streamlined approach to the original thread
3 Likes

Just got to peeking into the editor. My issue is the WU cost for calling our own app APIs. It’s not the cost of WU, but because technically I know that it can already be done client-side.

I don’t say it lightly when I say that this can easily be implemented as a native Bubble element. Cause I’ve been using a tiny plugin element, I built to parse JSON into a Bubble API datatype for close to a year.

5 Likes

Thanks for sharing this! Parsing JSON without plugins is something a lot of new Bubble users struggle with, so having a simple demo is really helpful. I checked out the editor and the data structure makes the logic easy to understand, especially for people who are just getting started with APIs.

The Debug Mode trick is great too — it’s one of the fastest ways to see if the JSON is being formatted correctly before building the rest of the workflow. Nice work!

1 Like

Taking a bubble custom data type and parsing into JSON is trickier…harder to deal with related data fields and fields that are optional sets.

I’m not expecting bubble to roll out a feature of :parse as JSON as has been suggested is being mulled over by bubble. It will likely land into the pile of technically too difficult and be left to rest.

Not really, a few plugins already have Bubble datatype records to JSON transforms.

In this case, it really is easy for Bubble to do clientside transforms of the different Bubble variables (datatypes, optionsets etc) into JSON and vice versa. It’s not a new concept. Bubble code is just another layer on top of code that a browser renders.

It most likely is more of UX and/or product fit issues than a technical one.

wow :star_struck: this is so helpful. thanks!!

What if the menu was electronic - where users could add quantities, notes, etc for each item in the menu. how would you show this?

I’m trying to build a survey form with similar logic. I need to see all the questions, in the correct order, and see which ones were filled out and which ones were not.

I’ve been looking through all I can find on marketplace under search term JSON and have not found one that works for fields that are Option Sets and fields that are Related data types.

Only one that I found that does the functionality that I can actually test and it fails. Its called JSONtools…below is the result I get when testing

[{\"again_option_example_conrad\":{},\"another_option_50k\":{},\"camelcase_text\":\"dfg\",\"color_normal_option_option_colors\":{},\"gender_normal_option_option_gender\":{},\"gender_option_option_gender\":{},\"name_text\":\"first\",\"normal_gender_option_option_gender\":{},\"option_gender_option_option_gender\":{},\"regular_field_name_text\":\"sagas\",\"related_class_custom_class\":null,\"related_company_custom_company\":null,\"Created By\":{},\"Slug\":\"watch-2\",\"Created Date\":\"2025-11-17T16:14:30.331Z\",\"Modified Date\":\"2025-11-17T18:03:50.213Z\",\"_id\":\"1763396070331x343611870195070800\"},{\"again_option_example_conrad\":{},\"another_option_50k\":{},\"camelcase_text\":\"asdg\",\"color_normal_option_option_colors\":{},\"gender_normal_option_option_gender\":{},\"gender_option_option_gender\":{},\"name_text\":\"second\",\"normal_gender_option_option_gender\":{},\"option_gender_option_option_gender\":{},\"regular_field_name_text\":\"asdf\",\"related_class_custom_class\":null,\"related_company_custom_company\":{},\"Created By\":{},\"Slug\":\"watch-1\",\"Created Date\":\"2025-11-17T16:14:37.617Z\",\"Modified Date\":\"2025-11-17T18:12:55.470Z\",\"_id\":\"1763396077617x355042584486077800\"},{\"again_option_example_conrad\":{},\"another_option_50k\":{},\"camelcase_text\":\"sadf\",\"color_normal_option_option_colors\":{},\"gender_normal_option_option_gender\":{},\"gender_option_option_gender\":{},\"name_text\":\"fsdf\",\"normal_gender_option_option_gender\":{},\"option_gender_option_option_gender\":{},\"regular_field_name_text\":\"dfg\",\"related_class_custom_class\":{},\"related_company_custom_company\":{},\"Created By\":{},\"Slug\":\"watch\",\"Created Date\":\"2025-11-17T18:03:05.863Z\",\"Modified Date\":\"2025-11-17T18:12:28.144Z\",\"_id\":\"1763402585530x938882761620455400\"},{\"again_option_example_conrad\":{},\"another_option_50k\":{},\"camelcase_text\":\"sadf\",\"color_normal_option_option_colors\":{},\"gender_normal_option_option_gender\":{},\"gender_option_option_gender\":{},\"name_text\":\"fsdf\",\"normal_gender_option_option_gender\":{},\"option_gender_option_option_gender\":{},\"regular_field_name_text\":\"dfg\",\"related_class_custom_class\":null,\"related_company_custom_company\":null,\"Created By\":{},\"Slug\":null,\"Created Date\":\"2025-11-17T18:19:45.676Z\",\"Modified Date\":\"2025-11-17T18:19:45.677Z\",\"_id\":\"1763403584981x270437141002846200\"},{\"again_option_example_conrad\":{},\"another_option_50k\":{},\"camelcase_text\":\"sadf\",\"color_normal_option_option_colors\":{},\"gender_normal_option_option_gender\":{},\"gender_option_option_gender\":{},\"name_text\":\"fsdf\",\"normal_gender_option_option_gender\":{},\"option_gender_option_option_gender\":{},\"regular_field_name_text\":\"created by matt in action\",\"related_class_custom_class\":null,\"related_company_custom_company\":null,\"Created By\":{},\"Slug\":null,\"Created Date\":\"2025-11-17T18:23:21.046Z\",\"Modified Date\":\"2025-11-17T18:23:21.047Z\",\"_id\":\"1763403800630x305436130717204500\"}]

A plugin element I have been working on can do fields that are option sets and the created by field…I’m still working through the related data type field. As of now I get this

[{"again":"number","another":"File 2 (51,200)","camelcase":"dfg","color_normal":"Yellow","gender_normal":"blue","gender":"green","name":"first","normal_gender":"female","option_gender":"male","regular_field_name":"sagas","related_class":null,"related_company":null,"Created By":{},"Slug":"watch-2","Created Date":"2025-11-17T16:14:30.331Z","Modified Date":"2025-11-17T18:03:50.213Z","_id":"1763396070331x343611870195070800"},{"again":"string","another":"exported","camelcase":"asdg","color_normal":"Yellow","gender_normal":"shade","gender":"red","name":"second","normal_gender":"male","option_gender":"female","regular_field_name":"asdf","related_class":null,"related_company":{},"Created By":{},"Slug":"watch-1","Created Date":"2025-11-17T16:14:37.617Z","Modified Date":"2025-11-17T18:12:55.470Z","_id":"1763396077617x355042584486077800"},{"again":"number","another":"File 2 (51,200)","camelcase":"sadf","color_normal":"Red","gender_normal":"male","gender":"female","name":"fsdf","normal_gender":"female","option_gender":"blue","regular_field_name":"dfg","related_class":{},"related_company":{},"Created By":{},"Slug":"watch","Created Date":"2025-11-17T18:03:05.863Z","Modified Date":"2025-11-17T18:12:28.144Z","_id":"1763402585530x938882761620455400"},{"again":"number","another":"File 2 (51,200)","camelcase":"sadf","color_normal":"Red","gender_normal":"male","gender":"female","name":"fsdf","normal_gender":"female","option_gender":"blue","regular_field_name":"dfg","related_class":null,"related_company":null,"Created By":"1746017197468x355524562164686800","Slug":null,"Created Date":"2025-11-17T18:19:45.676Z","Modified Date":"2025-11-17T18:19:45.677Z","_id":"1763403584981x270437141002846200"},{"again":"number","another":"File 2 (51,200)","camelcase":"sadf","color_normal":"Red","gender_normal":"male","gender":"female","name":"fsdf","normal_gender":"female","option_gender":"blue","regular_field_name":"created by matt in action","related_class":null,"related_company":null,"Created By":"1746017197468x355524562164686800","Slug":null,"Created Date":"2025-11-17T18:23:21.046Z","Modified Date":"2025-11-17T18:23:21.047Z","_id":"1763403800630x305436130717204500"}]

Do you know of one that you have used that works for fields that are option sets or related data types? Most of what I have seen is just JSON to thing, but not a bubble thing to JSON that works as I would want from a Parse as JSON function.

1 Like

Another option is to just upload a JSON file and use the Bubble API connector to point to the file…does the same thing without a need to run any workflows or hit the backend. But this is pretty cool as well. Thanks for sharing.

The last one I used is from JSON Assistant, I think. I don’t recall if field types of option sets worked though.

Technically speaking, once a Bubble object has been transformed to a JS object, it’s only a matter of how you want to transform that into JSON in a plugin.

I believe that is correct. What I am finding difficult is figuring out all the things Bubble does to transform it before they make it a JS object, especially for the different types of data we have. I have it working for Option Set fields on a custom data type, but they treat it differently if the main data type is an API Object that has a key whose value is an Option Set. Lots of little things to piece together to craft the correct JSON transformation rules.

I’m also toying with how to understand if a related data field is really empty versus not available due to privacy rules and what to put into that transformed JSON…and I’m not even yet really ready to take on what I would do to ‘fetch’ the related data field to craft nested JSON (just writing that sentence has my head spinning).

Having been around Bubble long enough, I imagine if they do come out with :parse as JSON it will be very limited and not necessarily meeting user expectations, or they may just scrape the plan completely and just say ‘we already gave them format as text, and that should suffice’. I’m personally not holding my breath for a built in :parse as JSON operator coming anytime soon.

:parsed as JSON is intended to be JSON string → Bubble rather than Bubble → JSON string.

2 Likes