Hi all,
I’m running into a weird behavior with a lookup step and templating.
What I’m doing
- Step 1 (Source / Search invoices): I fetch invoices and then group invoices by
id.
When there are two invoice groups, the output looks like this:
{
"page_of_records": [
{
"rows": [
{ "id": "150827" },
{ "id": "150827" },
{ "id": "150827" }
]
},
{
"rows": [
{ "id": "150832" }
]
}
]
}
- Step 2 (Lookup): I do a lookup with an additional search criteria:
- Formula (Numeric):
{billingtransaction.id} equal to {{{0.id}}}
Expected
I expect the lookup to run for both grouped invoices and return 2 results (one for id 150827 and one for 150832).
Actual behavior
- It gives 1 result
- The other one fails with:
Failed to generate criteria.3.searchValue from template: {{{0.id}}}. Details:
"id" not defined in undefined - 1:3.
Then on the next run, the other one works (like it flips which one fails).
Important detail
If the grouping produces only one group, it works fine:
{
"page_of_records": [
{
"rows": [
{ "id": "150827" },
{ "id": "150827" },
{ "id": "150827" }
]
}
]
}
Question
Why does {{{0.id}}} work when there’s only one page_of_records entry, but fails when the grouped output contains multiple page_of_records entries?
Is {{{0.id}}} pointing at the wrong level (page vs row), or does the lookup iterate differently when there are multiple pages?
Any guidance on the correct template reference for this grouped structure would be appreciated.




