Skip to content

Main content

Conditional Required Count Gap Tool

Calculate conditional required count gap from explicit caller-supplied inputs.

Loading tool…

Description

Count active required fields, missing required fields, and present fields outside the active-required set.

Identifier validation can involve several distinct questions: whether text has the expected shape, whether a checksum is consistent, and whether an authority actually assigned the identifier. Formatting and field extraction address narrower questions. Each result must be read according to the particular property the tool checks.

Count active required fields, missing required fields, and present fields outside the active-required set.

When to use this tool

Use Conditional Required Count Gap when you need the particular shape, formatting, field, or checksum property as one explicit stage in an identifier workflow.

How to use the tool and how it works

  1. Enter requiredWhenActive, active, present. Keep parallel arrays aligned. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read requiredCount, missingCount, surplusPresent. Use the output convention below.

Require aligned requiredWhenActive, active, and present arrays. Count rows where active and required, those additionally missing present, and present rows outside that active-required set as surplusPresent.1

Input fieldMeaning and unitsAccepted input
requiredWhenActiveRequired When ActiveRequired. Array of Boolean.; maximum items 256.
activeActiveRequired. Array of Boolean.; maximum items 256.
presentPresentRequired. Array of Boolean.; maximum items 256.
Output fieldInterpretationReturned shape
requiredCountRequired CountRequired. Safe integer.
missingCountMissing CountRequired. Safe integer.
surplusPresentSurplus PresentRequired. Safe integer.
json
{
  "input": {
    "requiredWhenActive": [
      true,
      true,
      false
    ],
    "active": [
      true,
      false,
      true
    ],
    "present": [
      false,
      true,
      true
    ]
  },
  "output": {
    "requiredCount": 1,
    "missingCount": 1,
    "surplusPresent": 2
  }
}

Limitations and assumptions

  • Counts are per position rather than per unique field identifier. Supplied booleans are trusted; extra presence is reported without deciding whether it should be rejected or content is valid.
  • The field tables state structural bounds; the mechanics also specify cross-field constraints. Malformed inputs and unsupported domains cause errors. A successful false flag, empty branch value, or zero placeholder has the meaning stated above and is distinct from an input error.

Alternative or Complementary methods

Use a complete format and checksum validator when required, then consult the issuing registry or verification process for assignment and identity. Preserve meaningful leading zeros as text.

References

  1. Calculation and input contract: validate/conditional-required-count-gap — tool.io

Similar or alternative tools