Hello guys, I’m starting now with n8n, and I’m not able to find a solution, the api where I’m getting the data passes an ID in the url as I show in the images below, but when I put it as a parameter it doesn’t identify, so I had to put it straight in the url, the problem is that the loop returns success only 1 time. I would like your help to improve the flow, returns success when looping the url.
I left the images here and I will also leave a copy of my stream. thanks.
essa é a url de exembro meusite.com/api/contacts/:id
Hi @egnine_team, looping through all input items would be the behavior.
However, in your Buscar_cliente_id
node you are referencing other items using the {{$node["url_clientes"].json["url_buscar_todos_clientes"]
expression which would only work for the first item of your url_clientes
node. If you replace this expression with something like $items("url_clientes")[0].json["url_buscar_todos_clientes"]
this would probably work as expected.
Here’s a demo I’ve put together based on your workflow using a public demo API:
Example Workflow
Hope this helps
1 Like
@MutedJam it worked yes, it works well, thank you very much. I’m really enjoying the community. I read a little bit about the global functions inside the flow. could you give me an example how I add to this flow that sent me the global role of ID_USER
I am glad to hear it works! Not sure I fully understand the follow up question though. Would ID_USER or its role be a response coming from the API you are connecting to? And where would you like to send it to?