Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

UI Action in SOW that asks from the user to draw a signature

Alon Grod
Tera Expert

Hi,

I know that if i use this script:

function onClick(g_form) {
    g_modal.showFields({
        title: "Enter your reason",
        fields: [{
            type: 'textarea',
            name: 'work_notes',
            label: getMessage('Reason'),
            mandatory: true
        }],
        size: 'lg'
    }).then(function(fieldValues) {
        g_form.setValue('work_notes', fieldValues.updatedFields[0].value);
        g_form.save();
    });
}

 

I will get this:

Screenshot 2023-12-25 at 21.17.02.png


but what if i want instead of free text that the user will have the option to draw a signature? what should be the type instead of 'textarea'?

1 REPLY 1

RikV
Tera Expert

I dont think servicenow has a signature feature by default, but someone correct me if i am wrong. I'v never seen it at least. 

 

What you could do is create a UI script in which you import a signature library like signature pad. This library supports entering a signature and saving it into an image file, which you could then store in a image or html field to make it usable in your notes. Kind of a work around, but that is the easiest way to do it i think. Does require some scripting knowledge as it has to be tailored to how you want to implement and use it.