Skip to main content
Known Participant
September 25, 2024
Question

contare valore in orizzonatale

  • September 25, 2024
  • 1 reply
  • 135 views

ciao a tutti, vorrei calcolare il valore AB(quante volte viene trovato questo valore) nei camp1- camp8-camp15-camp22-camp29-camp36-camp43, sono posti in orizzontale

grazie

1 reply

Souvik Sadhu
Community Manager
Community Manager
February 10, 2025

Hi @Felice29189474k2dv,

 

Hope you are doing. Thanks for writing in!

 

If you are looking for a solution, you can try the below steps: 

If you want the count to automatically update in a specific form field (e.g., "AB_Count"), follow these steps:

  1. Open your PDF form in Adobe Acrobat Pro.
  2. Select Prepare Form from the Tools menu.
  3. Add a new text field and name it "AB_Count".
  4. Right-click the AB_Count field → PropertiesCalculate tab.
  5. Select Custom Calculation Script, then click Edit and enter the following:

    var fields = ["camp1", "camp8", "camp15", "camp22", "camp29", "camp36", "camp43"];
    var count = 0;

    for (var i = 0; i < fields.length; i++) {
        var value = this.getField(fields[i]).valueAsString;
        if (value == "AB") {
            count++;
        }
    }

    event.value = count; // Set the count as the value of the AB_Count field

  6. Click OK, then close the properties window.
  7. Now, whenever the values in the specified fields are updated, AB_Count will automatically display the total count of "AB".

Hope this helps.


-Souvik