github.com/Ilhicas/nomad@v1.0.4-0.20210304152020-e86851182bc3/website/content/docs/job-specification/hcl2/functions/collection/values.mdx (about)

     1  ---
     2  layout: docs
     3  page_title: values - Functions - Configuration Language
     4  sidebar_title: values
     5  description: The values function returns a list of the element values in a given map.
     6  ---
     7  
     8  # `values` Function
     9  
    10  `values` takes a map and returns a list containing the values of the elements
    11  in that map.
    12  
    13  The values are returned in lexicographical order by their corresponding _keys_,
    14  so the values will be returned in the same order as their keys would be
    15  returned from [`keys`](/docs/job-specification/hcl2/functions/collection/keys).
    16  
    17  ## Examples
    18  
    19  ```shell-session
    20  > values({a=3, c=2, d=1})
    21  [
    22    3,
    23    2,
    24    1,
    25  ]
    26  ```
    27  
    28  ## Related Functions
    29  
    30  - [`keys`](/docs/job-specification/hcl2/functions/collection/keys) returns a list of the _keys_ from a map.