Describe the problem/error/question
I am trying to use the variable $itemIndex
within a JMESPath filter but it does not work. The variable is not substituted.
Here’s my expression:
{{ $json.data.insertId || $jmespath($input.all(), `[?pairedItem.item < '${itemIndex}' && json.data.insertId > '0'].json.data.insertId`).last() }}
Please share your workflow
Share the output returned by the last node
The output is the following:
[
{
"insert_id": 60
},
{
"insert_id": null
},
{
"insert_id": 61
},
{
"insert_id": null
},
{
"insert_id": null
}
]
While I am expecting:
[
{
"insert_id": 60
},
{
"insert_id": 60
},
{
"insert_id": 61
},
{
"insert_id": 61
},
{
"insert_id": 61
}
]
Information on your n8n setup
- n8n version: 1.32.2
- Running n8n via: n8n Cloud