I have a function Node, and by using the following code:
const PrintfulPayload = {
vars: items[0].json.vars
};
PrintfulPayload
return [
{
json: PrintfulPayload
}
];
I am able to get:
[
{
"vars":[
{
"id":6834,
"product_id":5,
},
{
"id":6835,
"product_id":5,
}
]
}
]
But the SplitInBatches seems to need the data without the array like:
[
{
{
"id":6834,
"product_id":5,
},
{
"id":6835,
"product_id":5,
}
}
]
If I try and get it without, like:
const PrintfulPayload = {
items[0].json.vars
};
PrintfulPayload
return [
{
json: PrintfulPayload
}
];
It throws an error. How do I get just a list of the array items?