Json array only returns the first 6 values

Describe the issue/error/question

Hi,
Getting straight to the problem, I have a http request node that returns an array. I then have it connected to a set node. I tried using {{ $json[10] }} to get the 11th value in the array but I keep getting undefined. I can only get values up to {{ $json[5] }} the rest is undefined. I’m not sure what is going on

Please share the workflow

Share the output returned by the last node

[
  1676419200,
  1268.73,
  1397,
  1277.62,
  1383,
  2005.56101713,
  1676332800,
  1221.04,
  1285.4,
  1239.72,
  1277.21,
  1998.1968361,
  1676246400,
  1205.77,
  1264.69,
  1258.35,
  1238.72,
  2023.79718954,
  1676160000,
  1238.03,
  1283.35,
  1275.65,
  1255.62,
  613.96707471,
  1676073600,
  1248,
  1279.23,
  1254.53,
  1275.65,
  670.81621193,
  1675987200,
  1230,
  1283.02,
  1274.01,
  1254.53,
  1547.68658087,
  1675900800,
  1257.74,
  1371,
  1366.56,
  1274.72,
  2305.42510301,
  1675814400,
  1350.15,
  1406.42,
  1385.55,
  1366.37,
  2227.7405557
]

Information on your n8n setup

  • n8n version: 0.215.1
  • Database you’re using (default: SQLite): default
  • Running n8n with the execution process [own(default), main]: default
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]: Docker

I’ve been struggling with that issue for over an hour (tried different node combinations, API URL parameters etc) but I resolved this a few minutes after posting this topic. The solution was to Include Response Headers and Status which let me use something like {{ $json.body[1][4] }} in the set node.

Updated flow:

2 Likes

Welcome to the community and thanks for sharing your solution @hash004, glad to hear you figured it out :tada:

1 Like

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