Select Component Setup with REST API

Here's the setup:

  • API endpoint which just lists out the users:

    "id": 2,
    "created_at": 1634683232774177,
    "firstName": "Darth",
    "lastName": "Vader",
    "email": "",
    "role": "coordinator",
    "isAdmin": true,
    "lastLogin": null

I'm trying to pull in the values and the labels from the call:

I get the data but I can't access the .id or the .firstname

It's probably just a dumb thing but voila.

Hi @toby , have you tried using the .map() method to retrieve .id or .firstName? For your setup something like this could work:

  • Values: {{ => }}
  • Labels: {{ => item.firstName) }}

You can also check out Retool University for more docs to get unstuck: Javascript in Retool

Hope this helps?

1 Like

I haven't but might try that