# Conditionally construct map

**URL:** <https://forum.elixirforum.com/t/conditionally-construct-map/64613>\
**Category:** Questions\
**Tags:** ecto, maps, phoenix\
**Created:** [July 1, 2024, 4:25am UTC](https://forum.elixirforum.com/t/conditionally-construct-map/64613 "2024-07-01T04:25:53Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![gregvaughn](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/gregvaughn/32/954_2.png) [@gregvaughn](https://forum.elixirforum.com/u/gregvaughn)\
**Post date:** [July 1, 2024, 9:54pm UTC](https://forum.elixirforum.com/t/conditionally-construct-map/64613/4 "2024-07-01T21:54:23Z")

</div>

I’d likely use a filter or guard `is_list(shipyard.ships)`

---

_[View the full topic](https://forum.elixirforum.com/t/conditionally-construct-map/64613)._
