Document template field mapping : Check box filed mapping PDf document template doesnot work

Kachu
Kilo Sage

Hi Community,  I am tired of trying the different options /script for mapping the check box with document template mapping

 I have tried different option like return  1/0,Yes/No,YES/NO,On/Off,yes/no,True/False,true/false,TRUE/FALSE

Can any one help me how could i map this field as i need to map multiple fields 

 here is the code :

(function evaluateMappingFieldValue(taskGr /* GlideRecord for parent task */, mappingField /* Pre-computed mapping field value */) {
gs.info('test');
	if(taskGr.u_graduate == true){
	gs.info('true');
		return 'yes'; 
	}
	else{
		return false;
	} 

})(taskGr, mappingField);

find_real_file.png

find_real_file.png

3 REPLIES 3

michaelj_sherid
ServiceNow Employee
ServiceNow Employee

Hi @Kachu when you preview the document does it show the check boxes populated? I have encountered this before and it had to do with the values that the PDF was configured for. Can you open the document in a PDF editor to see what the values are configured for the field? This may be the root cause. 

Regards,

Mike

@Kachu Were you able to identify the issue here with the check boxes?

Regards,

Mike

ppenkov
ServiceNow Employee
ServiceNow Employee

The only way I could get this to work was by doing

 

return 'Yes'; 

 

That seems to insert an X when you preview the PDF from a record, though when you generate and download it it displays as a tick.