- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2024 07:21 PM
We are capturing the user’s signature through a widget in the record producer and storing it in an image field called “u_sign_image” on the HR case table. However, when we attempt to include this signature in the HR document template using the “u_sign_image” field, it does not appear in the generated PDF.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2024 05:16 AM - edited 09-04-2024 05:18 AM
Hi @Sandeep Rajput
Thank you for your response. I managed to resolve this by replacing the image type field with an HTML field. I then wrote a business rule to generate an HTML image tag, using the source from the attached signature in the sys_attachment table. This HTML value was added to the HTML field on the table.
Now, I simply select that HTML field in the HR document template, just like any other field, and the signature image is included.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2024 09:17 PM
@kiran44 This is expected and the image is not going to be added automatically within the document. You can refer to this article https://www.servicenow.com/community/developer-articles/add-an-image-signature-in-a-pdf-using-quebec... and see if it helps to embed the image in your document.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2024 05:16 AM - edited 09-04-2024 05:18 AM
Hi @Sandeep Rajput
Thank you for your response. I managed to resolve this by replacing the image type field with an HTML field. I then wrote a business rule to generate an HTML image tag, using the source from the attached signature in the sys_attachment table. This HTML value was added to the HTML field on the table.
Now, I simply select that HTML field in the HR document template, just like any other field, and the signature image is included.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Hi @kiran44 ,
Will you please help me with you script used in hTML template as well as in Business rule as I have same requirement.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago - last edited 2 weeks ago
I'm editing this duplicate reply since I don’t see an option to delete it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Hi @Drishti ,
Business Rule used to construct an HTML string containing the image attachment (signature) and populate it into the u_sign field:
var recordId = current.sys_id;
var attch = new GlideRecord('sys_attachment');
attch.addQuery('table_sys_id', recordId);
attch.addQuery('table_name', 'sn_hr_core_case_total_rewards');
attch.addQuery('content_type', 'image/png');
attch.query();
while (attch.next()) {
var attachImage = '<img src="/sys_attachment.do?sys_id=' + attch.sys_id + '" width="120" height="50"/>';
}
current.u_sign = attachImage;
Then I just added u_sign field in Document template using selected variables:
Since the case flow is managed via Flow Designer after the case is created, we replaced the Business Rule with a Flow Action that replicates the same logic:
A Lookup Records action is used to fetch the relevant image attachment by applying conditions similar to those in the original Business Rule.
Once the attachment is retrieved, we construct an HTML string using the attachment’s sys_id.
The Update Record action used set the u_sign field with the constructed HTML string, along with other field updates.