Skip to content

Main content

Nonempty Exclusive Field Count Tool

Calculate nonempty exclusive field count from explicit caller-supplied inputs.

Loading tool…

Description

Count nonempty values, applying JavaScript trim first only when trimForPresence is true.

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 nonempty values, applying JavaScript trim first only when trimForPresence is true.

When to use this tool

Use Nonempty Exclusive Field Count 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 values, trimForPresence. 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 populatedCount, exactlyOne. Inspect exactlyOne before interpreting the associated values.

Count nonempty values, applying JavaScript trim first only when trimForPresence is true. Return populatedCount and exactlyOne when that count equals one.1

Input fieldMeaning and unitsAccepted input
valuesValuesRequired. Array of Text; maximum UTF-16 length 8192.; maximum items 256.
trimForPresenceTrim For PresenceRequired. Boolean.
Output fieldInterpretationReturned shape
populatedCountPopulated CountRequired. Safe integer.
exactlyOneExactly OneRequired. Boolean.
json
{
  "input": {
    "values": [
      "",
      " A ",
      ""
    ],
    "trimForPresence": true
  },
  "output": {
    "populatedCount": 1,
    "exactlyOne": true
  }
}

Limitations and assumptions

  • Values are text fields and the rule tests presence rather than semantic validity. With trimming disabled, whitespace-only text is populated; no field is selected, cleared, or coerced.
  • 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/nonempty-exclusive-field-count — tool.io

Similar or alternative tools