opentofu/website/docs/language/functions/values.mdx
Janos a15a6c9657
Versioned docs: replacing docs links with relative variants (#1537)
Signed-off-by: Janos <86970079+janosdebugs@users.noreply.github.com>
Signed-off-by: Damian Stasik <920747+damianstasik@users.noreply.github.com>
Signed-off-by: Roman Grinovski <roman.grinovski@gmail.com>
Co-authored-by: Damian Stasik <920747+damianstasik@users.noreply.github.com>
Co-authored-by: Roman Grinovski <roman.grinovski@gmail.com>
2024-04-24 13:24:30 +02:00

28 lines
618 B
Text

---
sidebar_label: values
description: The values function returns a list of the element values in a given map.
---
# `values` Function
`values` takes a map and returns a list containing the values of the elements
in that map.
The values are returned in lexicographical order by their corresponding _keys_,
so the values will be returned in the same order as their keys would be
returned from [`keys`](../../language/functions/keys.mdx).
## Examples
```
> values({a=3, c=2, d=1})
[
3,
2,
1,
]
```
## Related Functions
* [`keys`](../../language/functions/keys.mdx) returns a list of the _keys_ from a map.