Schedule Trigger >> [ERROR: Can’t get data for expression]

Does anyone have the slightest idea why this wouldn’t work?
All I did was drag and drop for those.

Code has:


if (Object.keys(items[0].json).length === 0) {
  return [
     {
       json: {
         results: 0,
       }
      }
  ]
}
return [
  {
    json: {
      results: items.length,
    }
  }
];

[email protected]

Hey @Mateusz_Bijakowski,

I suspect the issue will be that the item count is changing as you go, Luckily though the Trigger will only run once so for your expression you can use {{ $('Schedule Trigger').first().item.json['X'] }} and that should work.

Item count isn’t changing really.

  1. one trigger with 1 output
  2. one call to Jira, technically returns multiple rows
  3. Those rows are counted and returned as 1
  4. Then there is a block in the issue.

Also it seems like a bug to me?
If I put a reference to some data that is “static” on per row basic but changes from run to run I expect it to be picked up correctly for all rows and stay the same inside this run.

This login applies in other places in here and works as expected.

re your idea
{{ $('Schedule Trigger').first().json['Day of week'] }} this works (without .item) but makes me sad that it’s needed.

1 Like

Hey @Mateusz_Bijakowski,

Code nodes can lead to paired item references being lost so there are some cases where this sort of thing is expected.

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