Forum Academy Marketplace Showcase Pricing Features

Add multi-row JSON response from API workflow to database?

Hi.

I have a POST JSON response that includes multiple values per field. How do I input these values as rows in my database?

The JSON looks like this…
[
{
“event_id”: “1471638833133x182831615355125760”,
“user_id”: “1471655244258x553992367349565060”,
“user_name”: “toad stool”,
“user_id_other”: “1471642627948x481003036722540860”,
“cur_session”: 1,
“paired_with_dummy”: “no”,
“show_break_page”: “no”,
“show_survey_page”: “no”,
“response_type”: “success”
},
{
“event_id”: “1471638833133x182831615355125760”,
“user_id”: “1471655182260x244606220396235600”,
“user_name”: “donkey kong”,
“user_id_other”: “1471642668163x245075270999223000”,
“cur_session”: 1,
“paired_with_dummy”: “no”,
“show_break_page”: “no”,
“show_survey_page”: “no”,
“response_type”: “success”
},
{
“event_id”: “1471638833133x182831615355125760”,
“user_id”: “1471655133758x590398509986698600”,
“user_name”: “yoshil”,
“user_id_other”: “1471642704953x433251848211512000”,
“cur_session”: 1,
“paired_with_dummy”: “no”,
“show_break_page”: “no”,
“show_survey_page”: “no”,
“response_type”: “success”
}]

The endpoint is set up like so and is currently only populating my database with the first row. event_id:25760…user_id:235600…user_name:.toad stool…"

How do I bring in all the rows, not just the first row?

1 Like

@sridharan.s were you able to get a solution to this ?

I am trying to do something similar which is I have a POST JSON from Postman which looks like the below. I am trying to post each array item as an individual row in the Bubble DB.

[
{“heading” : “h1”,“description” : “d1”},

{“heading” : “h2”,“description” : “d2”}

]

I’m using schedule an “API workflow on a list” in backend workflows. However I do not know what parameters to define so the workflow event can detect the data from the oncoming JSON. I tried defining a parameter as type “list of things” I’m trying to post but it doesnt work (In the DB I have defined a thing called “posting” with fields heading and description).

I am running the API workflow on “post”

Postman gives an error saying “parameter post is missing”. However when I remove “post” parameter from workflow event and define no parameters, the error goes away but nothing is ofcourse created in the DB.

Would appreciate any help on how you managed to get around this.