Zachary Shilton 830140157d
website: remove obselete nav data (#10811)
* website: remove obselete sidebar_title frontmatter from docs

* website: bump to latest docs-page

* website: update plugin creation and registration docs

* website: fix broken links
2021-03-31 15:07:00 -04:00

36 lines
772 B
Plaintext

---
page_title: coalesce - Functions - Configuration Language
description: |-
The coalesce function takes any number of arguments and returns the
first one that isn't null nor empty.
---
# `coalesce` Function
`coalesce` takes any number of arguments and returns the first one
that isn't null or an empty string.
## Examples
```shell-session
> coalesce("a", "b")
a
> coalesce("", "b")
b
> coalesce(1,2)
1
```
To perform the `coalesce` operation with a list of strings, use the `...`
symbol to expand the list as arguments:
```shell-session
> coalesce(["", "b"]...)
b
```
## Related Functions
- [`coalescelist`](/docs/templates/hcl_templates/functions/collection/coalescelist) performs a similar operation with
list arguments rather than individual arguments.