JSON Parsing Help

Hello,

I’m going round in circles trying to parse the following JSON and save into my database:

{
“Output”: [
{
“Product SKU”: “ABC-1”,
“Stock Level”: 15,
},
{
“Product SKU”: “ABC-2”,
“Stock Level”: 20,
},
{
“Product SKU”: “ABC-3”,
“Stock Level”: 18,
}
]
}

Here is an example of the plugin setup I’m using. I’ve used the same setup on a different JSON output successfully but have no clue why it isn’t working on this occasion:

Screenshot 2024-01-27 at 17.20.35

I know the API connection is working as I’m saving the raw output to my database successfully each time but no luck with the parsing.

Any help to get me out of this jam would be appreciated!

  • Set up a Bubble endpoint with a return data from api action.
  • Set up an API call as an action to that endpoint (Bubble calling on Bubble) and you will get your JSON parsed without using plugins :smiley:

Thanks for the response! Would this method work with OPEN AI output as it comes through in one block which is why I’ve been using the plugin?

Absolutely!

You can pass your json schema to the OAI functions api and you can pass the completion’s JSON through the above structure to get your Bubble fields that can be used in your logic

Ok perfect, that’s great. You aren’t aware of any tutorials demonstrating such an action by any chance? Thanks for your help again!

Quick update, I’ve managed to set up the workflow in the API to return data from the API using this tutorial:

I feel like I’m pretty close as when I generated the API it parsed the data correctly. I now want to save this output into my database but it doesn’t seem to appear anywhere in the workflow.

When trying to create a new thing it is still appearing as the usual ‘choices’ output rather than the parsed data I saw when I initialised the call.

Can you suggest a fix for this? Thanks again!