A plugin for the Yaak platform that provides a simple way to coalesce multiple values into a single value based on conditional.
A Yaak template function that returns the first argument that is not null or empty (after trimming whitespace). Use it for inline “if variable A is empty, fall back to B, then C” logic in any Yaak input.
Install from the Yaak plugin registry via Settings → Plugins in the app, and search for Coalesce.
Access it from the autocomplete menu in any text input:
${[ coalesce(a, b, c) ]}
Pass environment variables (or other template functions) as arguments:
{[ coalesce( {env_primary}, ${env_fallback}, ‘default’) ]}
Yaak resolves each argument before handing it to the function, so coalesce checks the actual runtime value. The first argument that is not null, undefined, or blank is returned. If all three are empty, it returns null.
| Name | Label | Type | Required |
|---|---|---|---|
a |
Primary | text | no |
b |
Fallback | text | no |
c |
Fallback 2 | text | no |
Exactly three arguments are supported. Additional values are not read.
"") are skipped.undefined) are skipped." ") are treated as empty and skipped.null when no argument has a usable value.npm run dev # watch + rebuild on change
npm run build # one-time build
MIT