Calculate how many items are there in each category

New Here ,
Jul 07, 2022 Jul 07, 2022

Copy link to clipboard

Copied

PDF.PNG

I'm doing inventary of some items and I'm trying to count each Rented, Instock, Missing item and place it in their respective Total boxes. Each status box is a dropdown menu with the following options:
Rented

Instock

Missing 

Is there a way to use the Custom Calculation script feature to help me doing this.

 

Thank you in advance for reading and helping

TOPICS
JavaScript , PDF forms

Views

23

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jul 07, 2022 Jul 07, 2022

Copy link to clipboard

Copied

LATEST

For the Total Rented field you can use the following calculation script:

 

var count = 0;
for (var i=0; i<=32; i++) {
	if (this.getField("Status#."+i).valueAsString=="Rented") count++;
}
event.value = count;

 

Simply adjust the text in quotes and duplicate it for the other totals.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines