<p>That would be the same behavior for using <code>{id}</code> in the title format for new entries created in the control panel as well.</p>

<p>The problem with <code>{id}</code> is that's not known until the entry is already saved to the database since it's a database generated number.  That's why it's empty for new entries but re-saving the entry will cause it to appear.</p>

<p>The easiest thing to do would be to generate a <a href="http://twig.sensiolabs.org/doc/functions/random.html" rel="nofollow">unique ID</a> from the template and save it to a custom field on the entry.</p>

CC BY-SA 3.0
2016-01-14T21:18:02.500Z
2016-01-14T21:18:02.500Z
Brad Bell
<p>I have an entry form to take user generated content.</p>

<p>The section it passes the info to has a customised title format <code>Submission ID: {id}</code></p>

<p>However, when the entry gets submitted, the title in the CP (and indeed in the templates) just show as <code>Submission ID:</code> </p>

<p>It's not until the entry is re-saved at the control panel level (although I haven't tried a front end edit form) that the appropriate id shows e.g. <code>Submission ID: 12465</code></p>

<entries><form><entry><saveentry>
Assign entry id to title with entry form
# Assign entry id to title with entry form

(Asked by: username_0 on 2016-01-14)

I have an entry form to take user generated content.

The section it passes the info to has a customised title format `Submission ID: {id}`

However, when the entry gets submitted, the title in the CP (and indeed in the templates) just show as `Submission ID:`

It's not until the entry is re-saved at the control panel level (although I haven't tried a front end edit form) that the appropriate id shows e.g. `Submission ID: 12465`

**Tags:** entries, form, entry, saveentry

---

## 1 answers

### Answer by username_1 on 2016-01-14. Score: 2

That would be the same behavior for using `{id}` in the title format for new entries created in the control panel as well.

The problem with `{id}` is that's not known until the entry is already saved to the database since it's a database generated number. That's why it's empty for new entries but re-saving the entry will cause it to appear.

The easiest thing to do would be to generate a [unique ID](http://twig.sensiolabs.org/doc/functions/random.html) from the template and save it to a custom field on the entry.


---

