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

394
Vistas
How do I add my Google Apps Script signature code within my Google Forms

I found this code online, and it allows me to draw signaures with .gs and .html.

function doGet() {
  return HtmlService
      .createTemplateFromFile('index')
      .evaluate();
}
function saveToDrive(signature){
  var signature = signature.split(",")
  var blob = Utilities.newBlob(Utilities.base64Decode(signature[1]), 'image/png');
  var sheet=SpreadsheetApp.getActive().getActiveSheet();
  sheet.insertImage(blob, 1, 1);
}
    <!DOCTYPE html>
    <html>
    <head><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/></head>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
    <script src="https://cdn.rawgit.com/willowsystems/jSignature/master/libs/jSignature.min.js"></script>
    <body>
    <form>
    ...
    Signature:
    <div id="signature"></div><br>
    <img id="rendered" src="" style="display:none">
    <input type="Submit" value="Save" onclick="getSignature();"/>
    ...
    </form>
    </body>
    <script>
      document.getElementById("signature").style.border = "1px solid black";
      $("#signature").jSignature({
        'background-color': 'transparent',
        'decor-color': 'transparent'
      });
      function getSignature(){
        $("img#rendered").attr("src",$('#signature').jSignature('getData','default'));
        var signature = document.getElementById('rendered').src;
        google.script.run.saveToDrive(signature);
      } 
    </script>
    </html>

I just want to know how I intergrate it within my form, so that at the bottom, there is a place to sign, which then automatically saves to my google drive as a jpg, and is shown in my form as an image.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can adjust the code snippet to save the signature to your Drive and embed the WebApp URL in your form

For this:

  • Modify the saveToDrive function to
function saveToDrive(signature){
  var signature = signature.split(",")
  var blob = Utilities.newBlob(Utilities.base64Decode(signature[1]), 'image/png');
  blob.setName("signature");
  var file = DriveApp.createFile(blob);
}
  • Deploy your code as a WebApp with the settings: Execute the app as: Me, Who has access to the app: Anyone, even anonymous.
  • Now, I am not aware of a way to embed this WebApp into a Google form (you would need to create a custom HTML form for this), but what you can do is to provide a link to the WebApp as part of a question / response option and kindly ask the user to follow the link.

Here is a sample form (keep in mind that the WebApp is deployed as me, so if you provide a signature, it will be saved on my Drive and not yours ):

https://docs.google.com/forms/d/e/1FAIpQLSckCxKzrUdNvpcONLVRvJ08e5EDZRNB-tTfSRKG2YRLVjI_Ww/viewform

about 4 years ago · Juan Pablo Isaza Denunciar
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