# Flatten map(string) to List

**URL:** <https://discuss.hashicorp.com/t/flatten-map-string-to-list/23897>\
**Category:** Terraform\
**Created:** [April 30, 2021, 3:15pm UTC](https://discuss.hashicorp.com/t/flatten-map-string-to-list/23897 "2021-04-30T15:15:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jprouten](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@jprouten](https://discuss.hashicorp.com/u/jprouten)\
**Post date:** [April 30, 2021, 3:15pm UTC](https://discuss.hashicorp.com/t/flatten-map-string-to-list/23897/1 "2021-04-30T15:15:09Z")

</div>

I need to manipulate an output value to be a list.

Using a local how would I convert a map(string) to a list?

//  
app\_subnet\_id = tomap({  
“subnet1” = “subnet-xxxxxx”  
“subnet3” = “subnet-yyyyyy”  
})  
//

I just need it as [“subnet-xxxxx”, “subnet-yyyyyy”]

---

<div class="post-metadata">

**Author:** ![apparentlymart](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/apparentlymart/32/702_2.png) [@apparentlymart](https://discuss.hashicorp.com/u/apparentlymart)\
**Post date:** [April 30, 2021, 6:06pm UTC](https://discuss.hashicorp.com/t/flatten-map-string-to-list/23897/2 "2021-04-30T18:06:45Z")

</div>

Hi @jprouten,

I think you are describing what [the `values` function](https://www.terraform.io/docs/language/functions/values.html) does:

```auto
values(var.app_subnet_id)

```

(Assuming that `app_subnet_id` is an input variable; use `local.app_subnet_id` instead if it’s a local value.)
