Skip to content

Commit 8a4fdc3

Browse files
committed
Update docs for lookup() interpolation function
Add specifics about using the optional third argument for providing a default value.
1 parent b5d1279 commit 8a4fdc3

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

website/source/docs/configuration/interpolation.html.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,11 @@ The supported built-in functions are:
160160
* `${length(split(",", "a,b,c"))}` = 3
161161
* `${length("a,b,c")}` = 5
162162

163-
* `lookup(map, key)` - Performs a dynamic lookup into a mapping
163+
* `lookup(map, key [, default])` - Performs a dynamic lookup into a mapping
164164
variable. The `map` parameter should be another variable, such
165-
as `var.amis`.
165+
as `var.amis`. If `key` does not exist in `map`, the interpolation will
166+
fail unless you specify a third argument, `default`, which should be a
167+
string value to return if no `key` is found in `map.
166168

167169
* `lower(string)` - Returns a copy of the string with all Unicode letters mapped to their lower case.
168170

0 commit comments

Comments
 (0)