PDF Editing Issues

How to Reverse TRUE and FALSE Results in PDF Form Fields

Rana GarciaRana Garcia Oct 28, 2026 868 views

Question details

The user needs to reverse the displayed YES/NO results for TRUE/FALSE spreadsheet data imported into a PDF text field.

How to Reverse TRUE and FALSE Results in a PDF Form 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.
Before you start

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.

Solution 1Recommended

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.

1
Open Field Properties

In Adobe Acrobat's Prepare Form mode, right-click the target text field that receives the spreadsheet data and select 'Properties'.

2
Navigate to the Script Tab

Depending on where your existing logic is stored, go to either the 'Calculate' or 'Format' tab in the Properties window.

3
Edit the Custom JavaScript

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";`

4
Save and Test the Form

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.

Reverse the Conditional Logic in the Form Field Script
Match Exact Field Names: Ensure that the variable used in your script (e.g., 'sourceValue') exactly matches the field name referencing your imported spreadsheet data, and account for case sensitivity.
Edit PDF Forms Easily

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. 1. Open WPS PDF: Launch WPS Office and open your PDF document using the built-in PDF editor.
  2. 2. Access Form Tools: Navigate to the 'Form' tab on the top ribbon to interact with or edit form fields within your document.
  3. 3. Modify Field Properties: Double-click on a form field to adjust its properties, appearance, and text formatting.
  4. 4. Save Your Document: Once your form is configured correctly, click the 'Save' icon to preserve your interactive PDF settings.
Easily fill, view, and edit interactive PDF formsFully compatible with standard PDF formats and Microsoft Office formats (Word, Excel, PowerPoint)Lightweight, fast, and features a familiar user interfaceSeamlessly convert data between PDF and Excel spreadsheets
QA img-9

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.