API Connector - Arrays & Nested Arrays

Third party integration is getting hard because Nested Arrays are difficult to add in the input parameters. Exemple :

{
  "data": {
    "type": "product",
    "name": "My Great Product",
    "slug": "my-great-product",

    "price": [
      {
        "amount": 5891,
        "currency": "USD",
        "includes_tax": true
      },
      {
        "amount": 7150,
        "currency": "GBP",
        "includes_tax": true
      }

And it seems it’s not a rare use case :

@emmanuel Do you plan to empower the API Connector in a mid-term objective ?

2 Likes

Put your request in the body input - the big multiline input below the parameters area -instead of in the parameters. You’ll still be able to make the parameters dynamic by placing the keys inside “< >”

3 Likes

Yes, but it only works if the number of elements you’ve got in your list is definied.
I also know we can play with @mishav’s Toolbox plugin to re-create a nested array, but it is not sustainable for an API integration with numerous API calls.

If the nested array is being sent from a server action, i.e. not from a browser action, then your options are limited to either:

  • Build up the string or parts of it before the API call, and store it ready to send.

  • For example, as each price item is created or updated, create a string of the JSON object { amount, currency, tax }. Then all the strings can be retrieved in a list.

  • Another example is to use the List Item Expression to build up the whole list from a Browser action, and store it for use by the server action.

  • If the list contents depends on server-side actions, you could call an external service to help build up the string.

  • Possibly build up the string by running an API workflow on a list, I don’t particularly like this option so I haven’t tried it.

Thks @mishav for the sum up.
The post under the"Idea" category is more about a feature request @emmanuel so we make request continaing arrays mush easily without using such workarounds.

1 Like

@nicolas_dap,

Has there been any updates since May to how Bubble Connector passes nested key:pairs? Ran into your same issue with Sendgrid and adding meta data to emailed events.

Hello there! could you fix this? im having a similar problem

Can you please give me a tip on how to solve it?

thank you!

@kramwe @martin2
No, there is still no solution right now as far as I know. Here is one of Bubble’s limits.

it depends on the api though, some are nice enough to provide methods to combat other issues leading to this problem being solved in the connector… for those api’s anyway…

sur it depends on the API. The API Connector should adapt to all these possibilites.

yes agreed, i was more pointing out that in cases such as @martin2’s this nesting issue is actually not something that should be holding his integration back. At least this way people now know that there are options in some apis, to overcome this and they can proceed with there integrations while this gains enough support to proceed. Its not the most uncommon thing to find either, I can literally list 100’s of the worlds most used right now…

@jarrad @nicolas_dap So There is no way I can get it done?

I faced a similar problem using the Bubble API connector when responses were nested arrays. I was able to solve this with the Blockspring integration.

For example use Bubble > Blockspring > Your desired API > Blockspring > Bubble.
Instead of Bubble > Your desired API > Bubble.

Of course, this only works if your desired API is integrated with Blockspring and it adds a bit more complexity to the setup.

1 Like