[URGENT] Problem with API Response Field Mapping in API Connector

I am using the API Connector for an API that returns data based on CPFs (Brazilian tax IDs). The API response includes a ‘Dados’ object containing an object named after the searched CPF, which in turn contains a ‘Jurídico’ object with the desired data.

To set up the API, I used the CPF 09862138882. Therefore, Bubble created the response fields as "dados 09862138882 Juridico [Data]. However, when searching for other CPFs, Bubble cannot correctly map the response fields, as it expects to find the data under the same CPF key used in the original configuration.

How can I configure the API Connector to properly handle dynamic keys in the API response, so that I can perform searches for different CPFs without failing in the data mapping?

Hey I am sorry I am not 100% if this is what you are looking for.

You could try to manually give it the response and map it that way I had the same problem.
image

1 Like

It would save me a lot of time knowing it is there.

This type of API response cannot be parsed directly with API connector. You can look other topics about same case. This ia what we call a json dictionnaries. There’s plugins that can be used, create your own plugins to parse the response or use a third party tools like make.com

I came across the same issue with the firebase realtime database api.

I did a Tips Topic at the time solving it with the toolbox plugin server script action and a bit of Node.js code. Maybe it will help you: