So I have noticed that query data in not an array itself. It looks like this:
{
"line_item_id": [375,380,370],
"invoice_id": ["210406ROD-2","210406ROD-2","210406ROD-2"],
"sku": ["ANY-STK-0001","ANY-STK-0006","CAL-PAT-0006"]
}
So if I want to say count how many results returned I do this query1.data.line_item_id.length
instead of this query1.data.length
.
All other data objects (selectedRow.data, changeset etc.) are actually arrays. I have found my way around this until now.
I cannot use query.data in a Query JSON with SQL resource type like this:
select *
from {{qryLineItemsSelect.rawData}}
where count > 0
I get no results. But there are code samples in the docs and on the forums that do exactly that. Now if I transform query.data into an actual array of objects, it works.
So ummm, what in the devil am I doing wrong? Was there some master setting I bumped that transforms all of my query results to this object rather than array format?