# While loop Javascript, ciclo de más!

[Inicio](https://www.todoexpertos.com/) › [Javascript](https://www.todoexpertos.com/temas/javascript) › [Desarrollo web](https://www.todoexpertos.com/temas/desarrollo-web) › [Google Apps Script](https://www.todoexpertos.com/temas/google-apps-script)

- Fecha de publicación: 2018-06-22
- Enlace canónico (HTML): https://www.todoexpertos.com/preguntas/8toegfg4wljxylck/while-loop-javascript-ciclo-de-mas

## Pregunta

*Por Jairo Martínez* · 2018-06-22

Estoy haciendo un pequeño script usando google apps script, el cual es basado en js, el bucle debe de cumplirse mientras la columna donde están los emails sean diferente que vacío, pero el bucle no se detiene al llegar al string " " y se produce un error, dejo el código por si alguien puede ayudar!function Multpm() {
var asunto ="Envio automatico";
var fila = 9;
var direccion;
var mensaje;
  while( SpreadsheetApp.getActive().getActiveSheet().getRange(fila, 8) != ""){
    direccion = SpreadsheetApp.getActive().getActiveSheet().getRange(fila, 8);
    mensaje = SpreadsheetApp.getActive().getActiveSheet().getRange(fila, 8);
    GmailApp.sendEmail(direccion, asunto, mensaje);
    fila++;
  }
     SpreadsheetApp.getUi().alert("Mensajes enviados con éxito");
}

## Respuestas (0)

_Esta pregunta aún no tiene respuestas._

---
*Fuente: [https://www.todoexpertos.com/preguntas/8toegfg4wljxylck/while-loop-javascript-ciclo-de-mas](https://www.todoexpertos.com/preguntas/8toegfg4wljxylck/while-loop-javascript-ciclo-de-mas) — consultado el 2026-10-21. Al citar, enlaza la URL canónica e indica la fecha de consulta.*
