Michael Cruden
 · Seamless Technology Integration

Convert the API response variable type from string to double

In Bubble, when you connect to an API endpoint, it lets you map the returned values to variable types. This is what I think I am missing out on here. It seems that all data returned from API calls default to strings. I need to work with them as numbers (double) to allow for number formatting and the following expression.

What I want to do here is test if the value is greater or less than 0 & change the display color. Green if greater than 0, red if less than.

See attached image - I think I am on the right track. However, when I assign the variable I want to test against, the option to do "greater than" comparison goes away because it is defined as a string. How can I get this to work?

6 replies