Adding variables to the body of a HR Document Template breaks its previewDescriptionAdding variables to the body of a HR Document Template breaks its preview.Steps to Reproduce Steps to Reproduce: 1. Edit the OOB HR Document Template "Employee Verification Letter in USA" and add the following to its body:https://instance_name.service-now.com/sn_hr_core_document_template.do?sys_id=35e232209f22120047a2d126c42e70a9%26sysparm_view=document_templateQuestions Variable name: ${variables.variable_name}NOTE: to add the above, select Questions > Variable Name from the 'Select Variables' tree picker on the left of the Body (see screen shot). 2. Edit an OOB HR Template, i.e. "Template For Employee Verification" to use the "Employee Verification Letter in USA" document template in its PDF Template https://instance_name.service-now.com/uri=sn_hr_core_template.do?sys_id=0df40ffd6c8c1010f87799a161086cd33. Submit a new HR CAse with HR Service "Verification of Employment"4. Assign the case and, as the assignee, Ready for Work > Start Work5. Click on 'Sign Document'>> A blank 'Edit Document' popup is displayedWorkaroundIn Script Include "GeneralHRForm" Replace the lines starting at 379: for (var j=0; j < references.length;j++) { field = references[j]; if ( j == references.length-1) break; if (element.isValidField(field)) { if (element.getElement(field).canRead()) element = element.getElement(field).getRefRecord(); else { parsedBody = parsedBody.replace(matched[i], "<font color='#ff0000'>"+matched[i]+"</font>"); this.inaccessibleVariable.push(matched[i]); break; } } else break; } To for (var j=0; j < references.length;j++) { field = references[j]; if ( j == references.length-1) break; if (element.isValidField(field)) { if(!element.getElement(field)) gs.error("Element does not exists for the field : " + field); else if (element.getElement(field).canRead()) element = element.getElement(field).getRefRecord(); else { parsedBody = parsedBody.replace(matched[i], "<font color='#ff0000'>"+matched[i]+"</font>"); this.inaccessibleVariable.push(matched[i]); break; } } else break; } Related Problem: PRB1502334