# How to get struct from map - elixir?

**URL:** <https://forum.elixirforum.com/t/how-to-get-struct-from-map-elixir/4543>\
**Category:** Questions\
**Tags:** ecto, maps, structs, phoenix\
**Created:** [April 10, 2017, 6:48am UTC](https://forum.elixirforum.com/t/how-to-get-struct-from-map-elixir/4543 "2017-04-10T06:48:46Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![hubertlepicki](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/hubertlepicki/32/6822_2.png) [@hubertlepicki](https://forum.elixirforum.com/u/hubertlepicki)\
**Post date:** [April 10, 2017, 7:26am UTC](https://forum.elixirforum.com/t/how-to-get-struct-from-map-elixir/4543/7 "2017-04-10T07:26:02Z")

</div>

I use this code.

> <https://github.com/amberbit/mappable/blob/master/lib/mappable.ex#L17>

with original version coming from:

> **[Redirecting to Google Groups](https://groups.google.com/forum/#!msg/elixir-lang-talk/6geXOLUeIpI/L9einu4EEAAJ)**

---

_[View the full topic](https://forum.elixirforum.com/t/how-to-get-struct-from-map-elixir/4543)._
