How to Reverse TRUE and FALSE Results in PDF Form Fields
Question details
The user needs to reverse the displayed YES/NO results for TRUE/FALSE spreadsheet data imported into a PDF text field.

- Product
- Adobe Acrobat / PDF
- Device & OS
- not provided
- Scenario
- Importing spreadsheet data into a PDF form and formatting the displayed text based on boolean values.
- Observed behavior
- The text field currently displays YES for TRUE and NO for FALSE, but the user wants it to display NO for TRUE and YES for FALSE.
Ensure you have access to the PDF form's calculation or formatting scripts and verify that your imported spreadsheet data format is correctly mapped to the PDF field names.
Reverse the Conditional Logic in the Form Field Script
Modify the custom JavaScript calculation or formatting script of the PDF text field to swap the output values.
When mapping spreadsheet data like TRUE or FALSE to a PDF text field, Adobe Acrobat uses JavaScript to determine what text to display. By modifying this custom script, you can easily reverse the output logic to meet your specific formatting requirements.
In Adobe Acrobat's Prepare Form mode, right-click the target text field that receives the spreadsheet data and select 'Properties'.
Depending on where your existing logic is stored, go to either the 'Calculate' or 'Format' tab in the Properties window.
Select 'Custom calculation script' or 'Custom format script' and click 'Edit'. Change the logic to output the reversed values. For example: `if (sourceValue == "TRUE") event.value = "NO"; else if (sourceValue == "FALSE") event.value = "YES";`
Click 'OK' to save the script, close the properties window, and test the form by importing your spreadsheet data to verify the new YES/NO outputs.

Manage and Edit PDF Forms with WPS Office
WPS Office provides a comprehensive built-in PDF editor that allows you to view, fill, and manage PDF forms seamlessly. It is a lightweight and user-friendly solution for handling your daily PDF, Word, and Excel document needs all in one place.
- 1. Open WPS PDF: Launch WPS Office and open your PDF document using the built-in PDF editor.
- 2. Access Form Tools: Navigate to the 'Form' tab on the top ribbon to interact with or edit form fields within your document.
- 3. Modify Field Properties: Double-click on a form field to adjust its properties, appearance, and text formatting.
- 4. Save Your Document: Once your form is configured correctly, click the 'Save' icon to preserve your interactive PDF settings.

Frequently Asked Questions
Why is my PDF form field not updating when spreadsheet data changes?
This usually happens if the calculation order is incorrect or if the custom calculation script contains syntax errors. Check the field calculation order in your PDF form settings and ensure your JavaScript is error-free.
Can I map different spreadsheet text to TRUE/FALSE in a PDF?
Yes, you can write custom JavaScript in the PDF form field's formatting or calculation script to map any incoming spreadsheet string (like '1', '0', 'Pass', 'Fail') to TRUE, FALSE, YES, or NO.
Where do I add custom JavaScript in a PDF form field?
In form editing mode, right-click the text field, select 'Properties', and go to the 'Calculate' or 'Format' tab. Select 'Custom calculation script' or 'Custom format script' to enter your JavaScript code.




