Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Capturing signature images with signaturepad

curtisnelson
Kilo Explorer

We're using the Helsinki signature pad in our onboarding solution (to allow new hires to acknowledge documents), and we need to be able to capture an image of the signature and store in a separate database.   So far, all I can find are the points that make up the line segments of the signature (signature_image.data).   I noticed as I was playing around with the signature pad, that if I tested it by itself (not attached to a task), then looked in the signature_image table, there would be an attachment with the signature showing up.   Does anyone know what controls whether or not a signature image is generated?

Thanks,

Curtis

27 REPLIES 27

reedwowens
Giga Expert

Are you asking when does the SignaturePad capture an image vs when it only has the person's name?   If this is the case here is the answer:



  • First thing to understand is what the SignaturePad is trying to do.   It is capturing an action of verification from the user.   Two verifications are accepted by default
  • Signing their name in the graphics area will accept their verification and capture their signature.
  • Typing their name.   This will also accept their verification but it will NOT create any graphics


If you are trying to always get the user to provide a graphic signature, you must tell the SignaturePad UI page to only allow drawn signatures.   To do this the UI page must be passed a parameter sysparm_draw_only to be true.



Here is an example dialog that shows   Look at line 7 for the draw_only



var dialogClass = window.GlideModal ? GlideModal : GlideDialogWindow;


var dialog = new dialogClass('accept_signature');


dialog.setTitle('Please sign document');


dialog.setWidth("500");


dialog.setPreference('sysparm_document_id', task_sys_id);


dialog.setPreference('sysparm_table_name', task_table);


dialog.setPreference('sysparm_draw_only', 'true');


dialog.render();


Is it possible to add a Signature Pad to a custom table? Say I have a table of visitors who are not users and I need to capture their signatures...



Thank you in advance,



Mike


Yes.   Take a look at line 6 & 7 in my response.   Just put the record sys_id and the custom table name in those lines.  


Hi Reed,



I have not changed anything in the ui page.



This is everything I have in my ui action right now:


//Display a dialog to collect a signature


function showSignaturePad(){


    gDialog = new GlideDialogWindow('accept_signature');


    gDialog.setTitle('Signature Pad');


    gDialog.setWidth(500);
gDialog.setPreference('sysparm_table_name', u_performance_agreement);


gDialog.setPreference('sysparm_document_id', current.sys_id);
gDialog.setPreference('sysparm_draw_only', 'true');


    gDialog.render();


    return false;


}


If I take out lines 6 and 7 it works fine (other than not populating a document id or table name on my image record). If I leave them in, the ui page just keeps loading...




Any idea what I am doing wrong here??


I take it u_performance_agreement is the table name.   if so put quotes around it on line 6.   like "u_performance_agreement"