API Connector - how to get key name and values

Hey guys, an API I’m using to fetch data price returns values in an array as followed:

[
{
“USDC”: 15
},
{
“USDT”: 20
}
]

I’m displaying these in a repeating group, where I have a text to display the key name “USDC” and another text to display the key value “15”.

The issue is that the connector works with predefined object, but in this case the key name can’t be predefined. How can I get that done? Using “raw body text” doesn’t return anything so can’t use regex to extract values.

Thanks!

Exactly, this is not really possible in Bubble. Do you have “static” key? (always USDC AND USDT)? Or is it dynamic?

Bubble doesn’t support dynamic keys. You can use raw data type Text to get the raw data.

it’s dynamic

As suggested by @net-tt yu can use the raw body text (you need to activate both checkbox for error and header) or set the type to text instead of JSON and use a plugin that can convert the payload or a JSON plugin or REGEX

1 Like