Automation Blog

How to Set a Default Value as a Named Variable in Zapier Formatter

How to use Zapier's Formatter by Zapier step with the Default Value transform to create named fallback variables — guaranteeing downstream steps always receive a usable value even when the trigger field is empty, null, or missing, without needing a Code step.

ZapierFormatterVariables

By Troy Tessalone · · 4 minutes

Automation Guide

A practical field guide from Automation Ace.

How to Set a Default Value as a Named Variable in Zapier Formatter

Zapier trigger fields are often optional — a lead form might not include a company name, a webhook might omit a field entirely, or a CRM record might have a blank phone number. When you map an empty field to a downstream step, that step receives nothing — which can cause errors, malformed records, or silently wrong output. The Formatter by Zapier Default Value transform is the no-code way to intercept an empty field and substitute a fallback before it reaches any downstream step. The result is a named output field you can map anywhere in the Zap.

The Default Value Transform

In Zapier, add a Formatter by Zapier step and choose the Text event. Then select the Default Value transform. The configuration is:

  • Input: the field that might be empty (e.g., Company Name from the trigger)
  • Default Value: the fallback text to use if Input is empty or missing

The output is a single field named Output. If the input has a value, Output equals the input. If the input is empty or null, Output equals the Default Value you specified. Map the Formatter step's Output field in any downstream step instead of mapping the original trigger field directly.

Example: Default Company Name

A contact form trigger has a Company field that submitters often leave blank. You want to use "Individual" as the fallback when it's empty:

  1. Add Formatter by Zapier → Text → Default Value
  2. Input: Company (from trigger)
  3. Default Value: Individual
  4. In the CRM "Create Contact" action, map Company to the Formatter step's Output — not to the original trigger field

Any submission with a blank Company field now creates a contact with Company = "Individual" rather than an empty company field.

Creating Multiple Named Defaults in One Zap

Each Formatter step handles one field. For multiple fields that need defaults, add one Formatter step per field. Name each step clearly in the Zap editor (e.g., "Default: Company", "Default: Phone") so it's easy to identify which output to map where.

Alternatively, handle multiple defaults in a single JavaScript Code step:

// Code step: apply defaults to multiple fields at once
const company  = inputData.company  || 'Individual';
const phone    = inputData.phone    || 'N/A';
const source   = inputData.source   || 'Direct';
const priority = inputData.priority || 'Normal';

output = { company, phone, source, priority };

The Code step approach is more efficient for three or more fields — one step instead of three separate Formatter steps. For one or two fields, Formatter keeps the Zap no-code.

Using a Static Value as a Reusable Named Variable

A lesser-known use of the Default Value transform: create a named constant from a static value that doesn't exist as a field in the trigger. Set the Input to any always-empty field (or a field you know will be blank), and set the Default Value to your constant:

  • Input: a field that's always empty
  • Default Value: production (or any static string you want as a named variable)

The Formatter Output is always production. You now have a named field you can map anywhere in the Zap — useful for environment labels, static IDs, or configuration values that shouldn't be hardcoded directly into action steps.

A cleaner version of the same pattern: use the Formatter → Text → Default Value with a blank Input field and your desired constant as the Default. The step always outputs the constant, giving you a named, mappable value.

Default Value vs. Inline Fallback in Field Mapping

Zapier also supports a lightweight fallback inside field mapping using the | (pipe) syntax in some contexts, but this isn't universally available. The Formatter Default Value transform is the reliable, explicit version — it's always available, visible in the Zap step list, and creates a clearly named output field. The inline fallback is a shortcut that works in certain field types but can be invisible and hard to audit.

What Counts as "Empty" for Default Value

The Default Value transform triggers on:

  • An empty string ("")
  • A field that wasn't included in the trigger payload at all
  • A null value

It does not trigger on values like "0", "false", or "null" (the string "null") — those are non-empty strings and pass through as-is. If you need to treat those as empty too, use a Code step with explicit checks:

const raw = inputData.value;
const isEmpty = !raw || raw === 'null' || raw === 'undefined' || raw.trim() === '';
const value = isEmpty ? 'Default Text' : raw.trim();

output = { value };

Practical Default Value Patterns

  • Lead source default: Input = UTM Source, Default = Direct
  • Assignee default: Input = Owner Email, Default = team@company.com
  • Currency default: Input = Currency, Default = USD
  • Status default: Input = Status, Default = New
  • Numeric default: Input = Quantity, Default = 1 (then parse as integer in a Code step if needed)
The Formatter Default Value transform is the right tool when you need a single field's fallback handled cleanly and visibly in the Zap editor — no code required. For multiple fields or conditional defaults (different fallback depending on another field's value), a Code step is more expressive. Either way, the goal is the same: guarantee every downstream step receives a valid, usable value rather than an empty string that silently creates bad records.

For conditional defaults — setting a fallback value based on the value of another field — see if/else and switch statements in Zapier Code steps. For inserting the current timestamp as a default value, see inserting timestamps with Zap Meta in Zapier. For help designing a data validation and default-handling Zap, talk to Automation Ace.

ZapierFormatterVariables

Disclaimer: This article may include links to apps, products, or services. Some links may be affiliate links, which means Automation Ace may earn a commission at no extra cost to you.

Build Better Systems

Ready to automate with confidence?

Share your tools, process, and goals. Automation Ace can design the workflow, integration, AI assist, or code bridge that fits your business.

Start a Project