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
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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.
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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.