Document Template Advanced Scripting

mlamin
Giga Guru

Hello, I have a Form That needs to be filled out by multiple users. My goal also with the form is to make sure that the data that we already have is prepopulated on the form. So far I have all of the data being prepopulated. I am running into the issue of checking the box on the form. I am using scripting to set the scripting to checked. It seems that the box gets checked because when I download the form while user opens it to fill out it shows that the box is checked but the ServiceNow UI is not showing that. Please assist if you have any Ideas.

I have posted picture of my script that checks the box and the box being checked after download.

8 REPLIES 8

michaelj_sherid
ServiceNow Employee
ServiceNow Employee

Hi @mlamin this is most likely due to the PDF itself is looking for a different value than "Yes" which is common. When you open the PDF itself in Adobe Designer, or another PDF editing app, you will see the values to which the field is looking for to set the box to selected. Most likely the PDF is looking for a value of true, but you will have to verify on the PDF itself. Try this and let us know the outcome.

 

Regards,

Mike

Hello @michaelj_sherid, I looked at the PDF on a PDF editing app and the default option (Export Value) is "Yes" Which is why I think in the image I attached when I download the prefilled form, the PDF recognizes the value and puts and fills out the box. The script is correct and the field is being populated, I am just not sure how to get ServiceNow to see that value and fill in that spot. For other parts of the form that require- text, I can prepopulate them and they are displayed. This is only for the checkbox that I cannot get it to displayed, even though the value is true in the backend.

@mlamin Here is an older post where the user got it to work using 'Yes', but again it is dependent on your PDF document. I am happy to take a look if you can attach the PDF you are using. 


Regards,

Mike

Sandeep Rajput
Tera Patron
Tera Patron

@mlamin In your script, please replace 'Yes' with 'true' and see if it checks the checkbox.