Polling callrail api and grouping data, basic question

Describe the problem/error/question

I am trying to poll the callrail API at: https://api.callrail.com/v3/a/-myid-/calls.json?start_date=2023-09-12&end_date=2023-09-12

I get 2 results for that time frame and they are nested as follows using the HTTP request node, I am then trying to create a set that groups the data into rows of calls with sets I label such as ‘answered’, ‘recording’ etc as columns.

when I set the value to {{ $json.calls.answered }} it says [undefined] and I cant figure out what I should populate into the value to get all of the items in the array, the only way I can get the value to work is if I set it to: {{ $json.calls[0].answered }} but that then just gives me 0 array item and doesn’t list each in the output table.

Can you help me figure out how the workflow should change or what my value should be.

once again the current workflow is a execute workflow → HTTP request of the API → set

{
“page”: 1,
“per_page”: 100,
“total_pages”: 1,
“total_records”: 2,
“calls”: [
{
“answered”: true,
“business_phone_number”: “+1442349823498”,
“customer_city”: “Northbrook”,
“customer_country”: “US”,
“customer_name”: “SAMUEL”,
“customer_phone_number”: “+18423447845”,
“customer_state”: “IL”,
“direction”: “inbound”,
“duration”: 334,
“id”: “CALd6bbbaf18e524f8a982da2efd02721c0”,
“recording”: “https://api.callrail.com/v3/a/-myid-/calls/CALd6bbbaf18e524f8a982da2efd02721c0/recording”,
“recording_duration”: 319,
“recording_player”: “Login | CallRail”,
“start_time”: “2023-09-12T15:13:21.188-04:00”,
“tracking_phone_number”: “+18663878421”,
“voicemail”: false
},
{
“answered”: true,
“business_phone_number”: “+14423414085”,
“customer_city”: “Tuscaloosa”,
“customer_country”: “US”,
“customer_name”: “TIMOTHY”,
“customer_phone_number”: “+1205763745”,
“customer_state”: “AL”,
“direction”: “inbound”,
“duration”: 134,
“id”: “40a4e2a98ec54de2ba041f7”,
“recording”: “https://api.callrail.com/v3/a/-myid/calls/CAL6b4ee196440a4e2a98ec54de2ba041f7/recording”,
“recording_duration”: 113,
“recording_player”: “Login | CallRail”,
“start_time”: “2023-09-12T10:27:54.431-04:00”,
“tracking_phone_number”: “+186623423025”,
“voicemail”: false
}
]
}

What is the error message (if any)?

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Either use Item lists to break down calls, or use a code node to iterate through your $items and build a new output with $json.calls[n].answered.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.