Forum Academy Marketplace Showcase Pricing Features

Blockspring: Looking for help formatting the response for Bubble

Hi.

I’d like to leverage Blockspring to run a calculation that takes data from Bubble, does math, and returns a table back to Bubble. I’ve got the sending data to Blockspring part working, however, I’m unclear how to format the response so that I can input it in Bubble.

I’ve made the block available here:

The response currently looks like this and has 3 key-value pairs (event_name, role, thanks)

1). Does Bubble need JSON back?
2). The response comes back as 3 lists, how do I get this response into Bubble?

If JSON is the correct format for a response, any thoughts on how I input this data into my database? I need it to generate 3 rows (1 per key:value pair), as opposed to putting the list into a single cell.


One idea I had was to use the webhook feature in Blockspring and POST the data to blockspring because I know how to receive a JSON response from a POST.

I was able to get the POST working in Postman, but entering the same params in Bubble throws a formatting error. Here’s that example:

Post data from Postman to Blockspring generates the response I’d expect.

But, when I put the same params in Bubble, I get a formatting error.

Why might this work in Postman but not in the Bubble Connector? Is there a way to see what Bubble is sending to Blockspring when I initialize the POST call from Bubble Connector? This is not appearing in the logs.

1 Like

Can you share a link in run mode and we can have a look (we don’t expose POST data yet indeed).

Sure.

The block is called “Bubble-Blockspring-R_5” and you can find it in Blockspring search if this link doesn’t take you right to it. https://open.blockspring.com/kramwe/ed1786100010d621f5e94a8b47762038

The Bubble Connector API is called “API Blockspring” if you have access to the “CareerNumbers” app.

I’ve continued to work on this issue and believe that the data sent to Blockspring needs to be parsed somehow. It’s not clear to me what exactly Blockspring receives which would be helpful in troubleshooting the input. Your input here would be of great help.

Also for context, I’m sending this as a POST from the Bubble Connector because via a POST response (from a Scheduled API workflow on a list) is the only way I’m aware (thanks to Nigel and Levon) to populate the Bubble database with a multi-row response.

(Above) I tried to simply hit Blockspring directly from a workflow worked. The formatting of the input/ “do search” was recognized by Blockspring. But, I couldn’t figure out how to parse the results which were lists. The full list winds up in a single cell which is not what I need, so I’m not working with Bubble Connector and using a webhook approach now.

Looking forward to hearing your thoughts.

1 Like

I’ve created a test-app to show the issue I’m having POSTing from BubbleConnector to Blockspring. I’ve got the block working in blockspring, but when I POST the same data from Bubble to Blockspring, I get an error.

The block is public: “Bubble-Blockspring-Integration”

The bubble public test-app I’ve created is here. The POST is here:

The same POST in postman works (below). Bubble, however, throws an error. Any idea how I need to format the POST from Bubble so that Blockspring can receive the data?

1 Like

@emmanuel -

We’ve previously said BubbleConnector doesn’t yet handle nested JSON arrays. If this is still the case, how are folks getting data back from Blockspring?

The response$output generates nested JSON.

Here’s a response:

Beautified…

I’m looking to use the BubbleConnector via “Schedule a workflow on a list” to pull coln1 and coln2 key:value pairs from Blockspring as rows in my database in Bubble.

The block is public: “Bubble-Blockspring-Integration”

The bubble public test-app I’ve created is here. The POST is here:

1 Like

Sorry what is the question here?

If it’s about nested arrays, this one should be fine, because df is at the top level and is an array (the issue is if the array is one of the fields). But I’m a bit confused, is it a Workflow API question, or a Blockspring question?

My goal is to: send data (multiple key:value pairs) to Blockspring; have Blockspring run an R program; and return a JSON table back to Bubble.

The questions are: What format do I need to POST data to blockspring and how do I need to format the Blockspring response so that Bubble can accept it.

Summarizing above, I’ve taken the following approaches:

  1. Blockspring plug-in. While I was able to send data (multiple key:value pairs) to Blockspring; I don’t know a way to parse the response (which is a table) and insert that table into separate rows in Bubble.

Thanks to Nigel and Levon, I do know that I can use BubbleConnector and Schedule an API workflow on a list to return a table and insert it into my Bubble database row by row.

  1. So, in approach 2 (which at present I think is the only viable approach), I’m trying to POST data to Blockspring using the BlockspringConnector. However, Blockspring doesn’t like the format of the inputs and the Blockspring response looks to be a nested JSON array (eg. df).

Here’s a screenshot of the POST to blockspring. Blockspring doesn’t recognize the inputs. But this works in POSTman so it appears to be a Bubble thing.

.

Further, you can see that the response for df is coming back as one big list rather than separate parameters.

How do I format the POST parameters that are sent? How do I parse the nested df into separate parameters?

Thanks for your help.

You would do this by defining the value in the list of parameters (if you make them client-safe), you can use dynamic data. The “df” you’re talking about is the response, not the data the send, so i don’t think it’s relevant.

1 Like