Saving JSON to database

I have an API call that returns multiple objects with matching variables but different values for those variables.
E.g.
name = John
id = A1
name = Peter
id = A2

Now the API call recognises Name, ID etc as the variables but when I try to make a workflow to get name = John into my database it actually returns John, Peter under the name field.

What I want to do is have a workflow that, for each of the objects returned from the API call, create a new entry and assign the name to the name field and the id to the id field…

@jeetyajnik I just posted a video in response to this question on my YouTube channel. You can check it out here: How to Save Data From an API to Your Bubble Database | Bubble.io Tutorials - YouTube

In the video I go over a simple method for doing what I think you’re trying to do. You should also check out the bulk data api: Data API - Bubble Docs (I’ll do a video on this in the future). Hope this helps!

3 Likes

Thanks for the detailed explanation, this is exactly what I was looking for!

Hi guys, I need your help.

  1. I have a post workflow api working


  1. Then, I am trying to save some of the items in the json response into bubble database

  1. On settings section I have this

  1. I am getting nothing in the database. What I missed? Thanks in advance. Juan

Hi Jacob! How do I only get new things to the databse and not the once that then already exsists?

Hi Jacob,

Thanks for the tutorial ! When saving the JSON, how can we group imported values with already existing values in the DB so that there are in the same line ? I want to use the id as a common element to tell bubble to save the JSON (containing the id) in the corresponding line where the same ID is already present. Any idea ?

Hey @jacobgershkovich, appreciate the video. It all makes sense.

My challenge is subtly different where I’m creating JSON in the workflow that contains any number of key-value pairs. I would like an API Workflow (on a list) to create a new Thing for each key-value pair.

How can I take locally created JSON and do this? (without having an API call to build the structured data and define it as a Thing Type) like you do at the 7:00 mark?

Appreciate the help!
Al