HR Document Template|Scripting and Capturing Signature Date

Neha Mishra
Giga Contributor

We are using Servicenow Document Template module to generate the PDF Documents.

Current Challenges:

1. We are using record producers and variables and our requirement is to pull the record producer variable answers to the document template. We are unsure about which script to use there? We can use [+]fields to get the HR profile level and case-level information.

2. Signature Date is missing [Implementing 2 signature functionality, we are unable to get the signature date].

Any help/advice on what scripting works in HR Document Template would be really appreciated.

Sample HR Doc Template in Servicenow

find_real_file.png

10 REPLIES 10

Christian Prob2
Tera Guru

Hi @michaelj.sheridan - any comment / consideration here?

We are facing the same problem: How to get the signature date on an HTML template if there are multiple signatures.

Also - related - it would be great if scripts could be used to customize the content, similar to email-scripts in ITSM. That would make life soooooooo much easier 😉

Hi Neha,

Are you previewing the document after the signed date is set? This may be the reason why the dates seem to be missing. There is a quick workaround for this. A Problem has been reported where Signed dates are NULL when viewing the document using the "Preview Document" button.

Secondly, when using the PDF Template mappings you can use these variables on the Advanced mapping of the PDF template. You seem to be using the standard HR Document Template. A PDF Template version of your Document Template would give you the ability to map the variables into fields.

Regards,

Mike

Hello @michaelj_sherid 

You mentioned this is a known issue, but the post is quite old. Is this still an issue?

 

Follow up question: I have a document template (not HR PDF) that I have a document script to pull current system date, not signing date. This is always coming up null. Do you think this is related to "preview document" error, or a script issue? 

(function runTemplateScript(target /*GlideRecord for target task*/ ) { 
	var cd = new GlideDate(); 
	
	cd.setDisplayValue(gs.nowDateTime()); 
	
	template.print(cd.getByFormat("MMMM D, YYYY")); 

})(target); 

Hi @ErinF   Yes, this was rectified some time ago. This was specific to a use case where the document was signed (and signed date populated), then previewed again.  I believe it was a patch in New York that addressed the issue. If you are seeing the signed date NULL after it was populated and previewed again, I recommend to submit a support issue since this was addressed back in the New York release.

Regards,

Mike