Help saving parsed JSON into Bubble

Hi All,

I received JSON from an API call, and parsed the JSON into arrays.

I can see it in the console log:

JSON: 

[
  {
    "fruit": "apple",
    "color": "red"
  },
  {
    "fruit": "orange",
    "color": "orange"
  }
]

Parsed Item:  

{fruit: 'apple', color: 'red'}

I want to store each array in a separate data type, which is straightforward using API workflows.

I was trying Toolbox, but I can’t get the Javascript to Bubble to work in a workflow, not even in a Hello World test.

How do I save the parsed JSON into Bubble? Any ideas?

Thanks!
Jeremy

not sure why you’d need to parse the json

on api workflow set it to “detect request data” then send the data to it, the data structure will be recognised and saved

then just add a “api workflow on list” to iterate the array of objects in your example
in the second api workflow you can then create each object in the database

2 Likes

Thank you!

Hi there,

Yes definitely possible. See link to youtube video that helped alot.

Toolbox plugin has some quirks that can be confusing if not well versed with the plugin like for example when adding dynamic data to it you have to use “properties.parm1” in the script as well as making sure the communication bettween bubble dom and the script is talking can be difficult if using reusable elements or trying to get it to target elements on the page as opposed to talkin to the page level.

Title: How to integrate your Bubble app with OpenAI & ChatGPT to receive JSON Objects - By: Airdev

The link above was a great help for me trying to get multi nested arrays out of a json object from chat gpt.

Just pass the json into an API call to your app to use the bulk create feature…most efficient, performant and cheapest way

This topic was automatically closed after 70 days. New replies are no longer allowed.