<p>When I want to save an new Matrix block with an form to an existing Entry:</p>

<pre><code>&lt;form method="post" accept-charset="UTF-8"&gt;
  {{ csrfInput() }}
  &lt;input type="hidden" name="action" value="entries/save-entry"&gt;
  &lt;input type="hidden" name="entryId" value="{{ userentry.id }}"&gt;
  &lt;input type="hidden" name="enabled" value="1"&gt;
  &lt;input type="hidden" name="fields[matrixhandle][new1][type]" value="antworten"&gt;
  &lt;input type="hidden" name="fields[matrixhandle][new1][enabled]" value="1"&gt;
  &lt;input type="hidden" name="fields[matrixhandle][new1][fields][teilnehmer]" value="{{currentUser.username}}"&gt;
  &lt;textarea id="antwort" name="fields[matrixhandle][new1][fields][antwort]"&gt;
  &lt;input type="submit" value="Antwort speichern"&gt;
&lt;/form&gt;
</code></pre>

<p>The Problem is the Entry gets completely overwritten. The new Matrix block is saved correctly, but old blocks of the entry are discarded.</p>

<p>I see the possibility to read the old entry and add the old Matrix blocks as new ones, but this would not scale good and doesn't feel right.</p>

<p>How can I <em>add</em> new Matrix blocks to an existing entry with a front-end form?</p>

CC BY-SA 4.0
2019-06-24T19:44:13.703Z
Not sure what version of Craft and FeedMe you're on, but here are a couple of related Github issues to peruse. https://github.com/craftcms/feed-me/issues/403 and https://github.com/craftcms/feed-me/issues/313 and https://github.com/craftcms/feed-me/issues/463
Brad Bell
CC BY-SA 4.0
2019-06-25T07:51:15.403Z
Craft version: 3.1.30 i dont use FeedMe, i corrected the misleading code above. The matrix blocks dont get overritten, the complete entry will get overritten with the action "entries/save-entry", so i did the workaround to read out existing matrixblocks and iterate [new2], [new3] to save them again.
Rainer
<matrix><form><entries-field><frontend-form>
Add Matrix Blocks to existing Entry with Form without discarding existing Matrix Blocks
# Add Matrix Blocks to existing Entry with Form without discarding existing Matrix Blocks

(Asked by: username_0 on 2019-06-24)

When I want to save an new Matrix block with an form to an existing Entry:

  {{ csrfInput() }}
  
  
  
  
  
  
  
  


The Problem is the Entry gets completely overwritten. The new Matrix block is saved correctly, but old blocks of the entry are discarded.
I see the possibility to read the old entry and add the old Matrix blocks as new ones, but this would not scale good and doesn't feel right.
How can I add new Matrix blocks to an existing entry with a front-end form?

**Tags:** matrix, form, entries-field, frontend-form
> **Comments:**
> **username_1**: Not sure what version of Craft and FeedMe you're on, but here are a couple of related Github issues to peruse. https://github.com/craftcms/feed-me/issues/403 and https://github.com/craftcms/feed-me/issues/313 and https://github.com/craftcms/feed-me/issues/463  
> **username_0**: Craft version: 3.1.30 i dont use FeedMe, i corrected the misleading code above. The matrix blocks dont get overritten, the complete entry will get overritten with the action "entries/save-entry", so i did the workaround to read out existing matrixblocks and iterate [new2], [new3] to save them again.  

---

## 0 answers

