PDF Document Templates - Mapping a checkbox field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2018 06:54 AM
Hi folks,
Has anyone else explored the PDF Document Templates in depth? I have parsed the Federal I9 PDF form and there are several checkbox field types on the pdf. For whatever reason, I cannot mark these checkbox fields. I have tried mapping a true/false field from the HR Profile. I have tried just pushing 'true' through the script field in the mapping record. Also tried using 1 as an integer incase the PDF treated it this way.
Have you had any success populating a checkbox field? And to that point what about the other PDF field types that are not text?
Any help is greatly appreciated!
Thanks,
Ali Jubran
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-19-2018 06:03 AM
I found the answer to this. It seems that there is no standardized value that is used to pass through to a checkbox. You will need to extract the acceptable value from the document. To do so I used the GeneralPdfUtils() and the getFieldType() method will return all the fields, their types, and accepted values.
So for my specific document the I9, a check box is marked by passing "1". Other documents may be true/false, YES/NO, On/Off.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2019 12:04 PM
Hi Alijubran,
I am having the same issue. The question is Are you a US Citizen? Yes? No? The yes and no are checkboxes. I went to the document template and noticed there are 3 fields that will need to be mapped. Field 1: Are you a US Citizen? Field 2: Yes Field 3: No
I used scripts for the yes and no fields and I used the following script:
(function evaluateMappingFieldValue(caseGr /* GlideRecord for parent case */, mappingField /* Pre-computed mapping field value */) {
if (caseGr.u_us_citizen=='yes')
return '3b';
return 'Off';
})(caseGr, mappingField);
However its not working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2022 02:43 PM
Hey paradise624,
JavaScript will exit the function after the first return '3b'; so the Off will be ignored.