it turns out that the search in the database in the bubble does not need to be done every time after the splitInBatches, it could be before since the data does not change, I would just need to execute the node function fetching the random row, but, they need to be together to work , is there any way to do with the separate nodes? example below:
So your ‘Conversas’ node returns items that you want to loop over, and each loop needs to access the same data in the ‘Companhias-Recebe’ node?
It depends on what you’re doing inside the loop and how, but if you’re using a code node you could do the following:
Put the ‘Companhias-Recebe’ node before the ‘Conversas’ node (both outside the loop)
Activate the ‘Execute once’ setting on the ‘Conversas’ node
In your function node inside the loop, refer to the data in ‘Companhias-Recebe’ using $('Companhias-Recebe').all()
Although to be honest if you need to combine data from the two bubble nodes if may be more elegant to use a merge node instead. But hard to say without knowing exactly what you’re trying to do.
Thank you very much for your answer, now I’m closer to getting it.
the “Conversas” node returns me 52 items I want the “Linha Aleatória” node to take a random line from the “Conversas” node the JavaScript below works if the node is immediately before it.