Unexpected token F in position 0 --> js error

Hey!

I'm working with a RESTFUL API on Rockset, and I'm trying to pull the data out. When I try to pull the object's value and convert it to a string, I get this error:

Unexpected token F in JSON at position 0

What's the best way to pull a value from an object? Something like this is not working:

{{totalRevenue.data.results['0'].totalRevenue.toString}}

Here's an example of what the obj looks like:

  "results": [
    {
      "totalRevenue": 879
    }
  ]

The retool component I want to use is something like a text box, label, or whatnot- super simple. They can't accept objects, so I'm trying to convert my data to a string and display it.

Thanks!
n

Hmm, that is very strange, it seems to work fine for me:


Where are you doing this conversion?

Ohh I know what happened: it auto-filled for toString but not toString(). That's why I got the error. Fixed! Thanks!

No problem! Glad it was a simple fix! If you have any other questions in the future, don't hesitate to reach out again!