Workflow action

Validation & formatting

ut_validate

Validate IBAN, BIC, cards, emails, phones, postcodes and national IDs with check digits; format and parse numbers, money and phone numbers by locale.

Officialv1.0.06 functions Pure computation

About

What it does

Validation & formatting checks identifiers before they reach your finance, HR or CRM systems. It validates IBANs (country length and mod-97 check digits), BIC / SWIFT codes, payment card numbers (Luhn and issuer), email syntax, phone numbers (normalised to E.164 with a default country), postcodes for 26 countries and 13 national ID and tax number schemes such as the US SSN, UK National Insurance number, NZ IRD and NHI numbers, German Steuer-ID, French NIR and Indian Aadhaar. Each result has a valid flag, the normalised value to store and a plain-language reason when it fails; Validate many checks a whole form in one step.

The formatting side shows numbers the way each audience reads them: grouping and decimals per locale, percentages, compact numbers and currencies with their usual decimals, symbols or codes, and accounting brackets for negatives. Parse number reads amounts typed in any locale ("1.234,56 €" in German is 1234.56) and Format phone writes numbers as E.164, international or national. All checks run in the sandbox with no network access; they prove a value is well-formed, not that an account exists.

Good for

  • Check a supplier's IBAN, BIC and tax number before creating them in the ERP
  • Normalise customer phone numbers to E.164 for SMS and CRM sync
  • Show amounts in the customer's currency and locale in emails and documents

After installing

  1. Install the package: the action appears in Extensibility → Workflow actions and in the workflow designer's palette under Custom actions.
  2. Drag Validation & formatting onto a workflow after a form or API step, choose Validate (or Validate many for several fields) and map the values.
  3. Branch on {{check_valid}} or {{check_all_valid}} with a Branch by Condition step, and store {{check_normalized}} instead of the typed value.
  4. Try the included "Supplier bank details check (sample)" workflow from the API or its start form: it validates an IBAN, BIC, email and phone and formats the first payment amount.

Examples

Real inputs, real outputs

Each example ran in the sandbox when this gallery was built; the outputs are exactly what the step returns.

UK IBAN validate

Inputs

{
  "type": "iban",
  "value": "GB82 WEST 1234 5698 7654 32"
}

Outputs

{
  "valid": true,
  "normalized": "GB82WEST12345698765432",
  "reason": "",
  "details": {
    "country": "GB",
    "check_digits": "82",
    "bban": "WEST12345698765432",
    "formatted": "GB82 WEST 1234 5698 7654 32"
  }
}

Card number with issuer validate

Inputs

{
  "type": "card",
  "value": "4111 1111 1111 1111"
}

Outputs

{
  "valid": true,
  "normalized": "4111111111111111",
  "reason": "",
  "details": {
    "issuer": "visa",
    "length": 16,
    "last4": "1111",
    "masked": "************1111"
  }
}

Onboarding form fields validate_many

Inputs

{
  "items": [
    {
      "name": "Email",
      "type": "email",
      "value": "ap@example.co.nz"
    },
    {
      "name": "Bank",
      "type": "iban",
      "value": "DE89 3704 0044 0532 0130 00"
    },
    {
      "name": "Phone",
      "type": "phone",
      "value": "021 123 4567",
      "country": "NZ"
    },
    {
      "name": "Postcode",
      "type": "postcode",
      "value": "sw1a1aa",
      "country": "GB"
    }
  ]
}

Outputs

{
  "results": [
    {
      "name": "Email",
      "type": "email",
      "value": "ap@example.co.nz",
      "valid": true,
      "normalized": "ap@example.co.nz",
      "reason": ""
    },
    {
      "name": "Bank",
      "type": "iban",
      "value": "DE89 3704 0044 0532 0130 00",
      "valid": true,
      "normalized": "DE89370400440532013000",
      "reason": ""
    },
    {
      "name": "Phone",
      "type": "phone",
      "value": "021 123 4567",
      "valid": true,
      "normalized": "+64211234567",
      "reason": ""
    },
    {
      "name": "Postcode",
      "type": "postcode",
      "value": "sw1a1aa",
      "valid": true,
      "normalized": "SW1A 1AA",
      "reason": ""
    }
  ],
  "all_valid": true,
  "valid_count": 4,
  "invalid_count": 0
}

German amount to a number parse_number

Inputs

{
  "text": "1.234,56 €",
  "locale": "de-DE"
}

Outputs

{
  "value": 1234.56,
  "valid": true,
  "decimal_separator": ",",
  "group_separator": "."
}

Yen without decimals format_currency

Inputs

{
  "value": 1234567.8,
  "currency": "JPY",
  "locale": "ja-JP"
}

Outputs

{
  "formatted": "¥1,234,568",
  "currency": "JPY"
}

Reference

Functions, inputs and outputs

The designer generates each function's input panel from these declarations; outputs appear in the data picker with their types.

Validate validate

Check one value: iban, bic, card, email, phone, postcode or national_id. Returns valid, the normalised value, the reason it is invalid and type-specific details (card issuer, IBAN country, phone country code, formatted ID, …).

Inputs

  • type choice · required · iban / bic / card / email / phone / postcode / … — What the value is.
  • value string · required — The value to check (spaces and dashes are allowed where usual).
  • country string — Postcode: the ISO country (US, GB, CA, AU, NZ, DE, FR, NL, IE, ES, IT, …). Phone: the default country (ISO code or calling code such as 64) for numbers without +.
  • id_type choice · us_ssn / uk_nino / ca_sin / au_tfn / nz_ird / nz_nhi / … — For national_id: which scheme.

Outputs

  • valid boolean
  • normalized string — The value in its standard form (IBAN without spaces, E.164 phone, upper-case postcode with standard spacing, digits-only card number, …).
  • reason string — Why the value is invalid (empty when valid).
  • details object — Type-specific facts: iban country, bban and formatted; bic bank_code, country, branch; card issuer, last4, masked; email local, domain; phone country_code, national_number, international; national_id formatted.

Validate many validate_many

Check a list of { type, value } entries at once (e.g. every field of an onboarding form) and get one result per entry plus whether all are valid.

Inputs

  • items list of objects · required — List of { "type": "email", "value": "…", "name"?: "label", "country"?: "NZ", "id_type"?: "nz_ird" }.each: type (string), value (string), name (string), country (string), id_type (string)
  • country string — Used for phone and postcode entries without their own country.

Outputs

  • results list of objects — One per item, in order.each: name (string), type (string), value (string), valid (boolean), normalized (string), reason (string)
  • all_valid boolean
  • valid_count integer
  • invalid_count integer

Format number format_number

Format a number for a locale: grouping and decimal separators, percent (0.25 → 25%), currency, or compact (1.2K) notation.

Inputs

  • value number · required — The number. For percent, 0.25 is 25%.
  • locale string — BCP 47 locale, e.g. en-US, en-NZ, de-DE, fr-FR, ja-JP.
  • style choice · decimal / percent / currency — Plain number, percent or currency.
  • currency string — For the currency style: ISO 4217 code (USD, EUR, NZD, JPY, …).
  • minimum_fraction_digits integer — Optional: at least this many decimal places.
  • maximum_fraction_digits integer — Optional: at most this many decimal places (rounded).
  • use_grouping boolean — Group digits (1,234,567).
  • notation choice · standard / compact / scientific / engineering — Standard, compact (1.2M), scientific or engineering.

Outputs

  • formatted string

Format currency format_currency

Format an amount of money for a locale and currency, with the currency's usual decimals (JPY has none) and symbol, code or name.

Inputs

  • value number · required — The amount.
  • currency string · required — ISO 4217 code (USD, EUR, GBP, NZD, AUD, JPY, …).
  • locale string — BCP 47 locale, e.g. en-US, en-NZ, de-DE, fr-FR, ja-JP.
  • display choice · symbol / narrowSymbol / code / name — Symbol ($), narrow symbol, ISO code (NZD) or name (New Zealand dollars).
  • accounting boolean — Show negative amounts in brackets, e.g. ($1,234.50).
  • minimum_fraction_digits integer — Optional: at least this many decimal places.
  • maximum_fraction_digits integer — Optional: at most this many decimal places (rounded).

Outputs

  • formatted string
  • currency string

Parse number parse_number

Read a number typed the way a locale writes it: "1.234,56" in de-DE and "1,234.56" in en-US are both 1234.56. Handles currency symbols and codes, percent (12% → 0.12), brackets and minus signs, and local digits.

Inputs

  • text string · required — The number as text.
  • locale string — BCP 47 locale, e.g. en-US, en-NZ, de-DE, fr-FR, ja-JP.

Outputs

  • value number — The number (empty when the text is not a number).
  • valid boolean — Whether the text could be read as a number.
  • decimal_separator string — The locale's decimal separator.
  • group_separator string — The locale's thousands separator.

Format phone format_phone

Normalise a phone number to E.164 (+64211234567), or format it in international (+64 21 123 4567) or national (021 123 4567) style with simple grouping. North American numbers use (415) 555-0132.

Inputs

  • value string · required — As typed: with + and country code, or national with Country set.
  • country string — ISO country (NZ, US, GB, …) or calling code (64) for numbers without +.
  • format choice · e164 / international / national — Output style.

Outputs

  • formatted string — Empty when the number is not valid.
  • e164 string
  • valid boolean
  • reason string — Why the number is invalid (empty when valid).

Network

None. The action cannot make requests.

Data and files

None. It only sees its inputs.

Secrets

None.

Install

Install it in your workspace

Works on UserTasks cloud and any self-hosted instance. The action lands in Extensibility → Workflow actions, enabled, with its sample workflow.

In the app

  1. Open Extensibility → Workflow actions → Browse gallery and choose Install on Validation & formatting. Or download workflow-action-validation-formatting-1.0.0.utpkg and drag it onto Automations → Packages.
  2. The wizard verifies the checksum, every file hash and the signature, and shows what it adds.
  3. In the workflow designer, drag Validation & formatting from Custom actions, pick a function and fill its inputs. Save & Test shows the typed outputs.

With the CLI

shell
curl -fLO https://usertasks.com/gallery/workflow-action-validation-formatting-1.0.0.utpkg
usertasks packages install workflow-action-validation-formatting-1.0.0.utpkg
usertasks activities test ut_validate -f '{"operation":"validate"}'

Verify the download

File SHA-256
242b544172d3ab82251b00aec82d6e8d665954261b862cdf5d76d8bf14a2b271
Package checksum (what is signed)
sha256:1923884035e108b5cbf16b867c64884a576635c347d088820d5fb6274a9698eb
Module SHA-256
2f214f537ebc8bc9cab611955e978a2783ac97420c3624180f3908d14aa1f00c
Signer
UserTasks Gallery · 49:f3:04:90:47:02:4d:07:28:61:3d:dc:bb:aa:db:11

More workflow actions

All actions