Google App Syntax for One to Many Connections

Im trying to create new records based on “users” (I am using display names defined within the users table) inputted into a one to many connections field. However when I try to pull information from the fields, it comes up blank, this is an example oh what the webhook payload is:

field_93_val `[{“id”:“1234565abcd”,“val”:“John”},{“id”:“1234565abcd”,“val”:“Daniel”},{“id”:“1234565abcd”,“val”:“Michael”}]

Ideally I would be able to retrieve all entries within the field and iterate through each of the entries.

The topic below address something similar but the advice there did not help

https://community.tadabase.io/t/google-app-script-syntax-for-multi-field-variables-first-name-last-name/424

Thank you!

That’s a great point. I don’t think the script will work the way it is with an array.

I will ask an internal team member to take a look at that script.

Main question is, if you’re saving this to Google Sheets, where would you place each entery? Do you want to concatenate each one (“Joh, Daniel, Michael”) or save each to the next horizontal cell?

I’ve been able to access individual elements, my mistake was calling elements using ‘field_93_val[1]’ instead of ‘field_93[1]’ . However, I need to access the entire array at once.

What I am trying to do is whenever a record is created in Table A, where each record contains a file attachment, information recording the attachment, and the people required to approve it. The required people (number of people varies for each record) are assigned via the one to many User Table connection.

From there, I want to create individual tasks within a Task Table by accessing the one to many array within Table A and retrieving all elements of assigned users by passing the information to a Google Scripts App via Webhook.

My current issue is accessing the entire array of assigned users so I can use the REST API to create individual tasks within the Task Table for each of the users assigned. So far I can only access the ‘id’ portion of {“id”:“1234565abcd”,“val”:“John”} via field_93[1], which only has 3 elements. Calling field_93[5] returns nothing.

I see that within the webhook.site the entire array is visible, I just can’t access it via Google Scripts for some reason. I am outputting element calls to a Google Sheets for testing purposes.