API Post of multiple things

Hi!

I am trying to figure out how does one do a API call to POST data from Bubbleio, a list of things (a couple of rows and columns of Bubble data) to a webhook (a 3rd party webhook).

So the use case is, on an trigger, button press, I want to do a POST to webhook where the payload looks something like:

{
“records”: [
{“Bin”: “BIN01”, “HU”: “HU1234”, “Qty”: 9},
{“Bin”: “BIN02”, “HU”: “HU5678”, “Qty”: 5}
]
}

Where each record is a row in the Bubble database/thing. So the 3 columns of Bin, HU and Qty.

And each row in the JSON is an entry.

How do i config the API connector in terms of the JSON body?
And then what should the workflow that uses that API connector look like?

Thanks!

You can simply build the API call as post/get depending on 3rd part api.

Pass the required header and Key if there is any and then in body simply give it. Some dummy jaon as you want it

And call it, once successful. Then make the value as dynamic like *<value,>*.

Then when you want to call it, in any where either as frontend or as backend workflow , call the api Pass the dynamic value there and that set

If you ever stuck, ping me i will show you how to do it

Pleae use formatted text when posting JSON

{
    "records": [<records>]
}

This will make records a dynamic array,

Now in the workflow itself you will fetch list of data (using Do a search for) and use the function :formatted as text

Inside the formatted as text you will do

        {
            "Bin": "This item bin",
            "HU": "This item HU",
            "Qty": This item qty
        }

Where This item is always dynamic value from current item loaded. You set this in the top box and in the delimiter box, you put a comma (,)

2 Likes