Format Template
AI-generatedSummary
Formats one or more fields on each input item using selected transformations: country name to ISO2 code, phone number formatting via a pattern, or text case change (uppercase, lowercase, capitalize).
Inputs
- fieldsToFormat — Collection of fields to format. Each entry defines the field path, the type of transformation, and type‑specific options (pattern for phone, case for textCase). If omitted or empty, the node passes items through unchanged.
Output shape
main
Returns an array of items. For each item, the binary data is copied unchanged; the JSON object has the targeted properties replaced by their formatted values. If a field is missing, null, or undefined, it is skipped. Errors in field path or missing handler cause the node to fail; other runtime errors cause the item to be passed through unchanged.
Examples
Example 1: Format a US phone number
Set Fields to Format → Field Path: phone, Type: Phone, Pattern: (###) ###-#### (US)
Example 2: Convert a country name to its ISO2 code
Set Fields to Format → Field Path: country, Type: Country Code
Example 3: Make a name field uppercase
Set Fields to Format → Field Path: contact.name, Type: Text Case, Case: UPPERCASE