Skip to main content
Question

Zapier Platfom Build Trigger (Cannot read properties of undefined (reading 'map')


Hello! :)

Need help to understand this issue.

I want to build this Trigger in my build:

API configurations:

const options = {
  url: 'https://api.telavox.se/calls',
  method: 'GET',
  headers: {
    'Accept': 'application/json',
    'X-USERNAME': bundle.authData.username,
    'X-PASSWORD': bundle.authData.password
  },
  params: {
    'username': bundle.authData.username,
    'password': bundle.authData.password,
    'fromDate': bundle.inputData.fromDate,
    'toDate': bundle.inputData.toDate
  }
}

return z.request(options).then((response) => {
    response.throwForStatus();

    let items = response.data.items;
    return items.map((item) => {

    item.id = item.newID;
    return item;
    });


  });

API docs: https://developer.telavox.com/documentation/calls/

 

The reasion why im tryin to make a custom ID Field is because the array from the API don’t give me any id.

 

Error:

Cannot read properties of undefined (reading 'map')
What happened (You are seeing this because you are an admin):
  Starting GET request to https://api.telavox.se/calls
  Received 200 code from https://api.telavox.se/calls?username=XXX&password=XXX&fromDate=&toDate= after 422ms
  Received content "{"incoming":[{"datetime":"2024-01-17 11:28:17","dateTimeISO":"2024-01-17T11:28:17.652+0100","duratio"
  Cannot read properties of undefined (reading 'map')

Console logs:

Stack trace:
  TypeError: Cannot read properties of undefined (reading 'map')
      at Object.eval (eval at makeFunction (/var/task/node_modules/zapier-platform-core/src/tools/schema-tools.js:11:12), <anonymous>:23:18)
      at bound (node:domain:433:15)
      at Object.runBound (node:domain:444:12)
      at Object.tryCatcher (/var/task/node_modules/bluebird/js/release/util.js:16:23)
      at Promise._settlePromiseFromHandler (/var/task/node_modules/bluebird/js/release/promise.js:547:31)
      at Promise._settlePromise (/var/task/node_modules/bluebird/js/release/promise.js:604:18)
      at Promise._settlePromise0 (/var/task/node_modules/bluebird/js/release/promise.js:649:10)
      at Promise._settlePromises (/var/task/node_modules/bluebird/js/release/promise.js:729:18)
      at _drainQueueStep (/var/task/node_modules/bluebird/js/release/async.js:93:12)
      at _drainQueue (/var/task/node_modules/bluebird/js/release/async.js:86:9)
      at Async._drainQueues (/var/task/node_modules/bluebird/js/release/async.js:102:5)
      at Async.drainQueues [as _onImmediate] (/var/task/node_modules/bluebird/js/release/async.js:15:14)
      at process.processImmediate (node:internal/timers:476:21)
      at process.topLevelDomainCallback (node:domain:161:15)
      at process.callbackTrampoline (node:internal/async_hooks:128:24)

What is wrong? 

I have tried multiple things, but maybe i dont understand it :)

 

Please!

Did this topic help you find an answer to your question?

0 replies

Be the first to reply!