Capturing signature images with signaturepad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2016 07:38 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2017 07:38 AM
Yes that seemed to work super well. The only bit missing now is I can't get the document id on the image table to correspond to the record number on the performance agreement table.
Is my issue that I need to make my sys id some sort of string value?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2017 08:03 AM
Alex,
I'm not sure from your statements what you are trying to do. The SignaturePad "Signs" a record/document in ServiceNow. You can look up the image by:
1) Querying the "signature_image" table for the signature against the record you signed.
2) If found, then query the "sys_attachment" table for the attachment to the record found in #1.
---
If you are saying the signature_image record doesn't have the correct sys_id, then the problem is what you are passing on line 7.
When this routine is called, current must be defined to the record you want to "sign." This was the problem that you had before because you were using an uninitialized variable and passed "undefined" to the parameter. By quoting it, you passed a string. You must pass the correct sys_id.
You can insert a line in the routine like
alert('Sysid is " + current.sys_id);
around line 6 and see with an alert box what you are passing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2017 08:20 AM
My record in the signature table looks like this - I am missing the highlighted part, so yes, that line must not be pushing the right thing.
Since I can't quickly do that client side alert, and I can't insert it in my current ui because it won't load I made a new ui action to show me the sys_id of the record.
gs.addErrorMessage(current.sys_id) and when I click this ui action, it shows me the right value. So I am pushing the right value but its like I am not pushing it correctly.
This is my script right now and the ui page never loads... just says its still loading...
//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;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2017 08:35 AM
Alex,
Try something like this:
function SignRequest() {
var sysid = g_form.getUniqueValue();
var table = g_form.getTableName();
//Initialize and open the dialog
var dialog = new GlideDialogWindow("accept_signature"); //Instantiate the dialog containing the UI Page 'add_comments_dialog'
dialog.setTitle("Sign the Request"); //Set the dialog title
dialog.setPreference("sysparm_document_id", sysid); //Pass the comments into the dialog
dialog.setPreference("sysparm_table_name", table); //Pass in a short description for use in the dialog
dialog.render(); //Open the dialog
}
There is a difference between server side scripting and client. I use the above code to "sign" requests. It will work from any table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2017 08:44 AM
Well I can't say why that worked and the other method only did for the table but it is working now and I absolutely love it!!
Thank you so much for all your help, Reed!!
