Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

201
Vistas
Re-direct to a Google Form after running a Google App Script

I have created a Survey to collect information, and also wanted to collect the Geo location data.

I then created a Google App script which I have linked to the form with a link which is clicked by the user to run after completing the survey, this then adds the geo data into the same sheet.

after the script is run google displays text saying "this app was designed by a user and not google"

my question is, how can I let the script redirect them back to the form to submit another response, or at least to another html where they can click to submit a response again?

bellow is the current code I have for the script:

Gode.GS

function doGet() {
return HtmlService.createHtmlOutputFromFile("Index");
}function getLoc(value) {
var destId = FormApp.getActiveForm().getDestinationId() ;

var ss = SpreadsheetApp.openById(destId) ;
var respSheet = ss.getSheets()[0] ;
var data = respSheet.getDataRange().getValues() ;
var headers = data[0] ;
var numColumns = headers.length ;
var numResponses = data.length;
var c=value[0]; var d=value[1];
var e=c + "," + d ;
if (respSheet.getRange(1, numColumns).getValue()=="GeoAddress") {    
   respSheet.getRange(numResponses,numColumns-2).setValue(Utilities.formatDate
(new     Date(), "GMT+2", "dd/MM/yyyy HH:mm:ss"));
   respSheet.getRange(numResponses,numColumns-1).setValue(e);
   var response = Maps.newGeocoder().reverseGeocode(value[0], value[1]);
   f= response.results[0].formatted_address;
   respSheet.getRange(numResponses,numColumns).setValue(f);
 }
 else if (respSheet.getRange(1,numColumns).getValue()!="GeoAddress") {
   respSheet.getRange(1,numColumns+1).setValue("GeoStamp");
   respSheet.getRange(1,numColumns+2).setValue("GeoCode");
   respSheet.getRange(1,numColumns+3).setValue("GeoAddress");
 }
 }

Index.html

<!DOCTYPE html>
<html>
<script>
(function getLocation() {
if (navigator.geolocation) {
  navigator.geolocation.getCurrentPosition(showPosition);
  }
})()      
function showPosition(position){
var a= position.coords.latitude;
var b= position.coords.longitude;
var c=[a,b]
getPos(c)
function getPos(value){
google.script.run.getLoc(value);
}
}
/script>
</html>

The script is running and collecting the data. I just want to add a clickable link to display to the users to submit another response, or even redirect them automatically to the same form

Would really appreciate advice on the next step!

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda