How to traverse an array and insert record by record in the database?

20 views
Skip to first unread message

Reginaldo Junior

unread,
May 31, 2023, 10:43:03 AM5/31/23
to integra
Hello, I have an integration that returns an array of objects which I need to insert into the database, is it possible to scroll using While present in the Flow Tool? How can I do this?
Message has been deleted

Felipe Laera Ignacio

unread,
May 31, 2023, 11:26:06 AM5/31/23
to integra, slashju...@gmail.com
Hi, how are you?

To iterate over your array you can use the "for" module tool.

You will need to pass your array as a parameter and put the modules that you use to insert the data between the start and end of the for. 
Screenshot from 2023-05-31 11-49-45.png

Reginaldo Junior

unread,
May 31, 2023, 1:43:03 PM5/31/23
to integra, felipe...@skyone.solutions, Reginaldo Junior
Thank you, it solved my problem!

Caio Klein

unread,
May 31, 2023, 2:47:32 PM5/31/23
to Reginaldo Junior, integra, felipe...@skyone.solutions
Reginaldo,

Dependendo do volume de dados você pode inserir um array json com múltiplos registros (onde cada elemento é um objeto que representa uma linha do seu banco) diretamente nas tabelas do seu banco em um único comando.
Para isso é necessário usar funções dos bancos que mapeiam o JSON para as tabelas.

Colocamos alguns exemplos aqui:

Abraço,
Caio

--
You received this message because you are subscribed to the Google Groups "integra" group.
To unsubscribe from this group and stop receiving emails from it, send an email to integra-sky...@skyone.solutions.
To view this discussion on the web visit https://groups.google.com/a/skyone.solutions/d/msgid/integra-sky/ae48932e-502a-4d22-b3ca-b8be500e87ean%40skyone.solutions.

Reply all
Reply to author
Forward
0 new messages