# EctoNestedChangeset - Helpers for manipulating nested Ecto changesets

**URL:** <https://forum.elixirforum.com/t/ectonestedchangeset-helpers-for-manipulating-nested-ecto-changesets/51749>\
**Category:** Announcing\
**Tags:** forms, ecto, changesets, library, ecto\_nested\_changeset\
**Created:** [November 13, 2022, 12:36am UTC](https://forum.elixirforum.com/t/ectonestedchangeset-helpers-for-manipulating-nested-ecto-changesets/51749 "2022-11-13T00:36:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![woylie](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/woylie/32/38856_2.png) [@woylie](https://forum.elixirforum.com/u/woylie)\
**Post date:** [November 13, 2022, 12:36am UTC](https://forum.elixirforum.com/t/ectonestedchangeset-helpers-for-manipulating-nested-ecto-changesets/51749/1 "2022-11-13T00:36:28Z")

</div>

`ecto_nested_changeset` is a library for manipulating nested Ecto changesets. It was made to simplify building dynamic forms with nested resources.

[https://github.com/woylie/ecto\_nested\_changeset](https://github.com/woylie/ecto_nested_changeset)

The repository includes a demo application with a nested LiveView form.

> **[ecto\_nested\_changeset/example at main · woylie/ecto\_nested\_changeset](https://github.com/woylie/ecto_nested_changeset/tree/main/example)**
>
> main/example

```elixir
import EctoNestedChangeset

category
|> Ecto.Changeset.change()
|> append_at(:posts, %Post{title: "Padawan", comments: []})
|> prepend_at([:posts, 0, :comments], %Comment{body: "ecneitaP"})
|> delete_at([:posts, 0, :comments, 1], mode: {:action, :delete})
|> insert_at([:posts, 1], %Post{title: "have"})
|> append_at([:posts, 2, :comments], %Comment{body: "my"})
|> update_at([:posts, 0, :comments, 0, :body], &String.reverse/1)
|> Ecto.Changeset.apply_changes()

```
