Using get() and map()

Hi there,

We are attempting to connect our Zendesk account to a 3rd party software. The 3rd part software has customer ID’s that have been loaded into Zendesk as external ID’s. To simplify operations, we’ve added a single Zendesk search organizations module early on to be referred back to throughout the process. We’ve aggregated this into an array, and we are attempting to access the data through a set variable so that we can map it through a filter ahead. We’re running into many issues with Make.com not properly searching through the variables. Here is one example of an equation:

{{map(82.array; add(“external_id”; this.external_id; “id”; this.id; “name”; this.name))}}

Which returns this error:
Failed to map ‘value’: Function ‘map’ finished with error! Function ‘add’ finished with error! ‘external_id’ is not a valid array.

Protecting some data so it is cut off, but this is the array that it is attempting to pull from:

[
{
“array”: [
{
“id”: ,
“name”: “”,
“external_id”: “”
},
{
“id”: ,
“name”: ,
“external_id”:
},
{
“id”: ,
“name”: ,
“external_id”:
},

We’ve tried numerous different structures with no luck. It seems some of them are causing issues because of the Make UI adding “” to places where there should not be, and I don’t see how to add functions in script mode.

Any suggestions on how we could better attack this to handle the reference here?

Hey Wes,

what are you trying to achieve with that function exactly?

add() tries to add items to an array, but there is no array specified to add them to, hence the error.

But what are you trying to map? You can hover over the map() function to see what arguments it is expecting and some examples of outputs you can get with it.