# `AshBackendDrivenOptimisticUi.Effect.Insert`
[🔗](https://github.com/Undeadlol1/ash_backend_driven_optimistic_ui/blob/v0.1.0/lib/ash_backend_driven_optimistic_ui/effect/insert.ex#L1)

Puts the record a create makes, built from the rule's sets, into the list
the client holds of this resource, at its start or end, or, with
`at: {:sorted_by, field}`, before the first row whose `field` sorts after
its own, for a list the server orders by that field. The client gives it a
temporary id that the saved record replaces.

With `into:`, that list sits inside the one record the client holds:
`into: [:workout, {:exercises, workout_exercise_id: expr(arg(:workout_exercise_id))}, :sets]`.

# `t`

```elixir
@type t() :: %AshBackendDrivenOptimisticUi.Effect.Insert{
  __spark_metadata__: Spark.Dsl.Entity.spark_meta(),
  at: :start | :end | {:sorted_by, atom()},
  into: AshBackendDrivenOptimisticUi.Effect.nested_path() | nil
}
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
