How to populate dynamic fields value in E-signature document

Ayush Mishra2
Tera Expert

 

The customer's requirement is to have an HR Task with a task type of E signature. This task should enable them to view specific HR Case fields data on a document so they can add their signature to it.

2 REPLIES 2

Community Alums
Not applicable

Hi @Ayush Mishra2 ,

I don't think that's possible to have dynamic value from HR template.

You can using Business Rule to be run on Insert of HR task for particular HR Template by putting that in condition. Than update the Short Description of HR task using dot walking.

 

 

Riya Verma
Kilo Sage
Kilo Sage

Hi @Ayush Mishra2 ,

Hope you are doing great.

  1. Define the HR Case fields to be displayed on the document: You will need to identify the specific HR Case fields that should be shown on the document for the e-signature. These fields can be configured based on your HR Case table and requirements.Configure field based on your HR case table.

  2. Generate the document with the HR Case field data:

 

var hrCase = new GlideRecord('sn_hr_core_case');
hrCase.addQuery('<condition>'); // Add condition to retrieve the specific HR Case
hrCase.query();
if (hrCase.next()) {
  var template = new GlideTemplate('your_document_template'); // Replace 'your_document_template' with the appropriate template name
  template.setValue('field1', hrCase.field1); // Replace 'field1' with the desired HR Case field
  template.setValue('field2', hrCase.field2); // Replace 'field2' with another desired HR Case field
  // Add more setValue statements for each HR Case field you want to display
  var document = template.render();
}
​

 

  • use ServiceNow's IntegrationHub or leverage a third-party e-signature integration to enable e-signature capability
Please mark the appropriate response as correct answer and helpful, This may help other community users to follow correct solution.
Regards,
Riya Verma