Printing WiFi networks

Hello, im trying to print a list of the available wifi networks using the WiFi.scanNetworks() in arduino, ive also created a loop that prints it . My question is can i wait for the loop/program to finish searching before printing the list of available networks? I can print it on the webpage but it gets replaced everytime it iterates in the available networks.

byte available_networks = WiFi.scanNetworks();
  int netnum = 0;
  prevRssi = 0;

  for (int network = 0; network < available_networks; network++) {
     //client.print(network + 1);
     Serial.print(network + 1);
      //client.print(": ");
      Serial.print(": ");
      //client.println(WiFi.SSID(network));
      Serial.println(WiFi.SSID(network));
      netnum = network;
      prevRssi = (uint8_t)WiFi.RSSI(network);
    

Sorry my english is bad i can answer follow up questions regarding the post. thank you

This is not a node red related question. You need to post your question in an Arduino forum

im using node-red paired with mosquitto, sorry i forgot to mention that. Node-red replaces the values/ssid of the networks. I want to print them all at the same time and then repeat the search/loop

Without seeing your NR flow, no one but you knows what you are doing. In addition you only show a portion of the for loop of the arduino sketch.

So in the Arduino sketch are you storing all the wifi id's and sending them all to NR?
If not, how would NR know when the last one is sent?
In NR how are you displaying the names?
And what version of NR. node.js and the dashboard are you using?