Object Array as String

New to Retool :smile: So, be kind please :stuck_out_tongue:
Trying to create a simple app using the SendGrid API, which involves getting the contact id. I have gotten to the point where I have the array returned with the id in it, and now I need to pass that id over to another field. That's where I am getting stuck.

The response looks like:
{
"result": {
"test@test.com": {
"contact": {
"address_line_1": "",
"address_line_2": "",
"alternate_emails": ,
"city": "",
"country": "",
"email": "test@test.com",
"first_name": "Test",
"id": "849c6514-6651-480c-b4d4-ab4e0df21963",

I need to be able to send updates back to SendGrid using the id field but cant get that far.

image

Any help would be greatly appreciated.

From the snippet you provided, it looks like you would need to enter getContactId.data.result['test@test.com'].contact.id to get to the ID key's value.

1 Like

Hello @4shg85 , Welcome to retool's community.
I understand your question and I have 2 solution as per your response like:

  1. If id comes under contact object then id get like this : getContactId.data.result['test@test.com'].contact.id
  2. If id comes in result object then you get id like: getContactId.data.result['test@test.com'].id

If you have more questions or problem then feel free to ask.

1 Like