github.com/muratcelep/terraform@v1.1.0-beta2-not-internal-4/website/docs/language/functions/coalescelist.html.md (about) 1 --- 2 layout: "language" 3 page_title: "coalescelist - Functions - Configuration Language" 4 sidebar_current: "docs-funcs-collection-coalescelist" 5 description: |- 6 The coalescelist function takes any number of list arguments and returns the 7 first one that isn't empty. 8 --- 9 10 # `coalescelist` Function 11 12 `coalescelist` takes any number of list arguments and returns the first one 13 that isn't empty. 14 15 ## Examples 16 17 ``` 18 > coalescelist(["a", "b"], ["c", "d"]) 19 [ 20 "a", 21 "b", 22 ] 23 > coalescelist([], ["c", "d"]) 24 [ 25 "c", 26 "d", 27 ] 28 ``` 29 30 To perform the `coalescelist` operation with a list of lists, use the `...` 31 symbol to expand the outer list as arguments: 32 33 ``` 34 > coalescelist([[], ["c", "d"]]...) 35 [ 36 "c", 37 "d", 38 ] 39 ``` 40 41 ## Related Functions 42 43 * [`coalesce`](./coalesce.html) performs a similar operation with string 44 arguments rather than list arguments.