# Convert a nested struct into a nested map

**URL:** <https://forum.elixirforum.com/t/convert-a-nested-struct-into-a-nested-map/23814>\
**Category:** Questions\
**Tags:** elixir-map\
**Created:** [July 8, 2019, 6:46pm UTC](https://forum.elixirforum.com/t/convert-a-nested-struct-into-a-nested-map/23814 "2019-07-08T18:46:04Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![wolfiton](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/wolfiton/32/15884_2.png) [@wolfiton](https://forum.elixirforum.com/u/wolfiton)\
**Post date:** [July 8, 2019, 7:29pm UTC](https://forum.elixirforum.com/t/convert-a-nested-struct-into-a-nested-map/23814/5 "2019-07-08T19:29:22Z")

</div>

Wouldn’t s/he be able to use

```elixir
variable_with_struct
|> Enum.each
|> Map.from_struct

```

Like this?

> **[Enum — Elixir v1.20.2](https://elixir.hexdocs.pm/Enum.html)**

Also if i am mistaken please correct me(still learning to think in elixir and the language)

---

_[View the full topic](https://forum.elixirforum.com/t/convert-a-nested-struct-into-a-nested-map/23814)._
