Copy link to clipboard
Copied
I need a little help. I am terrible with JavaScript on a good day.
I have a form used to audit project compliance. I've been manually counting the number of Findings on each audit. I assume there must be a way to have Adobe complete this task for me. All of the drop downs affected by this script are named "Finding." 1-14. I need to count all instances where there is a finding, omitting the selections of "OK - No Finding" or "Select" displaying the summed value in the "Count" field. TIA!
Copy link to clipboard
Copied
Yes, this can be done using a script. Enter this code as the custom calculation script of the "Count" field:
var total = 0;
for (var i=1; i<=14; i++) {
var f = this.getField("Finding."+i);
if (f.valueAsString!="Select" && f.valueAsString!="OK - No Finding") total++;
}
event.value = total;
Find more inspiration, events, and resources on the new Adobe Community
Explore Now