Hi everyone, I’m working on a currency converter app using the Exchangerate API. The response includes a conversion_rates
field, which is a JSON object containing currency codes and their exchange values, like this:
“conversion_rates”: {
“USD”: 0.1759,
“EUR”: 0.1573,
“JPY”: 25.62,
…
}
My goal is to transform this key-value object into a dynamic list of options for a dropdown.
However, Bubble doesn’t treat this object as a list. It breaks it into individual fields like conversion_rates USD
, conversion_rates EUR
, etc., which means I can’t extract or load this into a dropdown dynamically.
I’m still learning to Bubble and don’t know advanced stuff yet, so any help or simple examples would be greatly appreciated! 
Editor
If you can somehow store your json into the database
you can use a json reader to do your task
can you tell me how can i do this? if you have any example or tutorial
have you checked the editor yet?
that would give you a rough idea on what to do
If that’s not enough, do let me know, I can guide further
If you’re willing to guide me a bit more, I would truly appreciate it. I’m still learning how to work with API in Bubble, so any help would mean a lot.
Since I dont have the exact API
I dont know how is it set up
So here is a rough idea
first set up the return as text
Then use regex extract to extract
“conversion_rates”: {
“USD”: 1,
“AED”: 3.6725,
…
Regex:
"conversion_rates"\s*:\s*\{[^}]*\}
Then set up the json just like the one in the editor, your dropdown then works
afterwards, to convert the text to list, there might be a way, but the easiest method might be javascript
but storing it as json works just fine
ask if you dont get anything
It worked that way
So it appeared like this (as in the photo below). Using it as text, can I show the currency conversion?
Show the currency conversion where?
Here.
I had the idea of storing the result in a custom state called “converted currency”, which is of type text. My plan is that when the user clicks the “Convert” button, it will trigger the API call, and then the result will be saved into that custom state.
And here is how I’m trying to put the value in the custom state (I don’t know if it’s the best way, but that’s what I thought)
If it works, then why not