Skip to content

Main content

Allergen Source Label Count Tool

Count explicit public label-source references without determining allergen presence or absence.

Loading tool…

Description

Count requested-label occurrences and distinct matching source IDs separately.

Food-safety records connect lots, samples, tests, labels and handling events. Consistent identifiers and reconciled quantities support record review, but do not establish safe food, complete traceability or valid regulatory approval.

Count requested-label occurrences and distinct matching source IDs separately.

When to use this tool

Use Allergen Source Label Count when you need a specified food-handling record or traceability diagnostic.

How to use the tool and how it works

  1. Enter sourceIds, labels, requestedLabel. 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 distinctSources, occurrences. Use the output convention below.

Require aligned source IDs and labels. Count requested-label occurrences and distinct matching source IDs separately.1

Input fieldMeaning and unitsAccepted input
sourceIdsSource IdsRequired. Array of text; maximum UTF-16 length 8192; maximum items 256.
labelsLabelsRequired. Array of text; maximum UTF-16 length 8192; maximum items 256.
requestedLabelRequested LabelRequired. Text; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
distinctSourcesDistinct SourcesRequired. Safe integer.
occurrencesOccurrencesRequired. Safe integer.
json
{
  "input": {
    "sourceIds": [
      "s1",
      "s2",
      "s1"
    ],
    "labels": [
      "A",
      "B",
      "A"
    ],
    "requestedLabel": "A"
  },
  "output": {
    "distinctSources": 1,
    "occurrences": 2
  }
}

Limitations and assumptions

  • Repeated rows can increase occurrences without increasing sources. Exact supplied labels are not an independent allergen identification or assurance of safe consumption.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.

Alternative or Complementary methods

Review the complete controlled records, actual product condition and applicable validated procedures. Authenticate sources and approvals rather than treating one matching token or balance as a safety verdict.

References

  1. Calculation and input contract: food-safety/allergen-source-label-count — tool.io

Similar or alternative tools