Our Blog.

Learn more about data collection and management, software updates, trends specific to your industry, and more.

Home  Blog

Simplifying Inspections with Dynamic Aggregation

Mar 10, 2020

Safety walkthroughs, Compliance audits, diagnostic maintenance—your business relies on checklist inspections to keep the lights on. Whether your inspection is on behalf of a client or ensuring your operation is citation free, checklists are a part of all our lives.

These tasks may feel mundane, but there’s more to them than clearing off your daily/weekly/monthly to-do list. In fact, your checklists are a treasure trove of information, waiting to be mined and refined into business optimizations.

Counting the results of checklist inspections is one of the first steps in discovering data-driven business insights. Learning that safety incidents have increased 7% over the last year or that the average number of non-compliant items has decreased since an intervention can both be determined by simply counting the results of your checklist inspections.

Challenges in Counting Inspection Items

Counting seems like an easy enough task. You’ve heard the phrase the devil’s in the details, well another is that complexity is a real-world problem. The reality is that things change and your data collection, while static at times, is a moving target over the long term. New regulations, modifying standard operating procedures, or even expansion of business can throw a wrench into your analytics.

For example, let’s take a standard classroom safety checklist, which has ten Yes/No questions. We want to know how many infractions—answered Yes—there are for each inspection. We check each question for a “Yes” response and increment our yes-counter each time found.

But what happens if we add an item to the checklist? That’s one more question to add logic for. What about if we remove an item from the checklist? That’s a question that needs its logic removed.

Our checklist is simple, but maintaining it is a burden at best, a liability at worst. There had to be a better way, and we found it.

Dynamically Aggregate Option Lists

We identified that these types of counting scenarios had a few common characteristics.

  1. Often, the questions were grouped together
  2. Possible responses originated from the same source
  3. Occasionally there some questions should not be included

From here a solution was developed to aggregate an option any time it appears within its form. The built-in function option.count() requires two pieces of information—and accepts a third optional value. Let’s look at the function’s definition and then a working example.

To use the function, call it from within the iformbuilder object.


The first value is the Option List ID that will be searched for. The second value is the Key Value from the Option List that will be counted. Finally, the third value is an array of element names to search through. If this is omitted, then the built-in function will search the entire form. Be careful though, the function does not include parent and children forms.

Now, on to the working example. We’re going to be counting responses from a safety walkthrough checklist. Each question can be answered as Yes, No, or N/A. Our Option List ID is 348542. In order to count all of the Yes responses we will add a Read-Only element to our form with the Dynamic Value iformbuilder.option.count(348542, “Yes”)

Since we want to search every element that uses this Option List ID we won’t include the third parameter.

What’s so great about this function?

We’ve eliminated the need to either copy or create a Page-Level JavaScript function, the Read-Only element will adapt when elements are added or deleted from the form, and the Dynamic Value is significantly easier to type, which means time saved debugging.

This function is the result of collaboration between our team and customers sharing their experiences. For more information on dynamically counting your option list values please visit our Customer Success Center and if you’d like to share your stories with our team please do so at stories@zerionsoftware.com.

Categories: Big Data, iFormBuilder
About Zerion Software

We're committed to learning, sharing, and growing with you. Content added regularly. Check our social channels for more.

Not Sure What do Do Next?

Haven’t found what you need? Search below! Your answer could be one click away.

Keep Learning from THE EXPERTS

We are proud of the work we do and so we share it. It’s not a matter of building good software or delivering a great training, we strive to make a difference with knowledge.