---
page_title: values function reference
description: The `values` function returns a list of the element values in a given map. Learn how to use the `values` function in Packer templates.
---

⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️
> [!IMPORTANT]  
> **Documentation Update:** Product documentation previously located in `/website` has moved to the [`hashicorp/web-unified-docs`](https://github.com/hashicorp/web-unified-docs) repository, where all product documentation is now centralized. Please make contributions directly to `web-unified-docs`, since changes to `/website` in this repository will not appear on developer.hashicorp.com.
⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️

# `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`](/packer/docs/templates/hcl_templates/functions/collection/keys).

## Examples

```shell-session
> values({a=3, c=2, d=1})
[
  3,
  2,
  1,
]
```

## Related Functions

- [`keys`](/packer/docs/templates/hcl_templates/functions/collection/keys) returns a list of the _keys_ from a map.
