Add namespace to JSON response

const paymentsInfo = []
for(const payment of items){

// to get a list of individually iterable items
payment.json.map(i => ({json:i})).forEach(j => paymentsInfo.push(j));

}

I want the name added as prefix to JSON response. something like
{“Receipts”:[{},{},{}]}
instead of
[{},{},{}]

@Jan @Jon Pls help

Hey there,

Without having my instance in front of me to have a play it is a bit tricky but looking at it the quickest option would be to just return something like

{"Receipts": paymentsInfo }

Although it would need some testing, as an ugly workaround it might get you going.

@Jon function node should return [], how can I return the above

Ah yeah that will get you. So you would need to do it as an array and tweak it in your next node or in your next node use the expression editor to add in the Receipts part.

ok…thanks will try…appreciate it @Jon