How to include an element inside the object with "node set"?

How to include an element inside the object with “node set”?

I’m making a request to report the recurrence of products in the order from the recurrence of customers, in order to generate a list of products.

It is necessary that an item with the purchase number be inserted into the purchase object in each item of the array.

for example:

"item":{
         "numeroPedidoLoja": "2000005891958290", //item to be inserted
         "codigo":"13545-C",
         ...

Below is the model of the array that I want to iterate and include the item “NumeroOrderLoja” of each purchase order:

"numeroPedidoLoja": "2000005891958290",
"itens":[
   {
      "item":{
         "codigo":" 13545-CT-9",
         "descricao":"Balança Digital Cozinha Receita E Dieta Precisão 1g Até 10kg Sf-400 Branco",
         "quantidade":"6.0000",
         "valorunidade":"7.8900000000",
         "precocusto":null,
         "descontoItem":"0.00",
         "un":"UN",
         "pesoBruto":"0.00000",
         "largura":null,
         "altura":null,
         "profundidade":null,
         "descricaoDetalhada":"",
         "unidadeMedida":"cm",
         "gtin":""
      }
   },
   {
      "item":{
         "codigo":"13545-C",
         "descricao":"Balança De Cozinha Digital Electronic Sf-400 Pesa Até 10kg Branco",
         "quantidade":"4.0000",
         "valorunidade":"10.0000000000",
         "precocusto":null,
         "descontoItem":"0.00",
         "un":"UN",
         "pesoBruto":"0.00000",
         "largura":null,
         "altura":null,
         "profundidade":null,
         "descricaoDetalhada":"",
         "unidadeMedida":"cm",
         "gtin":""
      }
   }
],

Hey @hlf,

I am not sure what you are trying to do here, Are you trying to add numeroPedidoLoja to each item in the itens array?

exactly, but I would like to know if there is a way to do this directly within the “set node”?

Hey @hlf,

Not that I can think of, You would need to use a Code node to handle it… or maybe an item lists node to split itens then a set node to add it :thinking:

2 Likes

Yeah I guessed, I did exactly that with the item lists node. I asked the question if there was a possibility to do it directly with node set.

Hey @hlf,

In that case… no :slight_smile:

1 Like

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