Msg array to individual objects

I have the following statement if (obj.profit.percent < close) { msgSell.payload.push(obj.id)} sending array to function output "msgSell" which currently looks like this:

Screenshot 2022-12-08 201206

I need to transform that into individual msg objects that must look like this:

image

which are received with let trade_id = msg.payload.id

Stuck on this for several days. Even when I manage to transform it to something that looks right, I can't catch the variables. Thanks!

Pass the array in payload through a split node then through a change node which sets the payload to the jsonata value {"id": payload}

Could you please share the flow of those two nodes?

Which part do you not understand?

  1. Pass the array in payload through a split node
  2. then through a change node
  3. which sets the payload to the jsonata value
  4. {"id": payload}

Ok, I got it - thank you.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.