Show a PDF Field Value Above 5000 in Adobe Acrobat
Question details
Display the value of CALC_P4H_TOTALS in another PDF form field only when it is greater than 5000.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- A PDF form needs a calculated field that displays a source total only when it exceeds a threshold.
- Observed behavior
- The destination field should show the source value above 5000 and remain blank at 5000 or below.
Open the PDF in an Acrobat version that can edit form fields, and confirm that the source field is named CALC_P4H_TOTALS and the destination field is named CALC_HTotal>5000. The script expects the source value to be a plain number without currency symbols or thousands separators.
Add a custom calculation script to the destination field
Use this method to display the source total only when it is greater than 5000.
Open the PDF in Adobe Acrobat and select All tools > Prepare a form.
Double-click the CALC_HTotal>5000 field to open its Properties dialog, then select the Calculate tab.
Select Custom calculation script, click Edit, and enter: var v = Number(this.getField("CALC_P4H_TOTALS").valueAsString); event.value = (v > 5000) ? v : "";
Confirm the script, close the field properties, and save the PDF. Enter or calculate source values of 5000 and 5001 to verify that the destination is blank for 5000 and shows 5001 for 5001.

Work with PDFs and Office files in WPS Office
WPS Office is a free, lightweight alternative with a familiar interface for working with PDF and Microsoft Office files. It can help you move everyday document work into one app, but use Acrobat to configure and test this custom PDF calculation script.

Frequently Asked Questions
What happens when the source value is exactly 5000?
The destination field stays blank because the script uses v > 5000, not v >= 5000.
How can I include 5000 in the displayed values?
In the destination field's Calculate tab, edit the custom calculation script and change v > 5000 to v >= 5000.
Why does the destination field not update after the source total changes?
Check that the source field name in the script exactly matches CALC_P4H_TOTALS. If the source is calculated, check the field calculation order in Prepare a form and calculate the source before the destination.
Can the source value include a currency symbol or thousands separator?
The script uses Number() on the source field's valueAsString, so symbols or separators may prevent conversion. Use a plain numeric source value or adapt the script to handle the source format.




