Answers.Body: <p>Something like this should do what you're looking for:</p>
  
  <pre><code>{% if not object.id %}{{ craft.entries.section('scripts').order('postDate DESC').first().title + 1 }}{% else %}{{ object.title }}{% endif %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-07-07T21:44:40.200Z
Answers.Text: Is there a way to make this trigger ONLY when a brand new entry is saved? When the entry is updated and saved the title continues to be changed.
Answers.UserDisplayName: Steven Thate
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-07-08T02:36:03.700Z
Answers.Text: Updated answer...
Answers.UserDisplayName: Brad Bell
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-07-11T20:32:24.623Z
Answers.Text: Amazing. Thank you so much! I had no idea that a field could be so powerful...
Answers.UserDisplayName: Steven Thate
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-30T19:31:02.330Z
Answers.LastActivityDate: 2017-07-08T02:35:56.060Z
Answers.LastEditDate: 2017-07-08T02:35:56.060Z
Answers.UserDisplayName: Brad Bell
Body: <p>I am attempting to make one of my sections use auto-generated titles. I am making my first entry with a title like <code>8000</code>. What I need is the second entry to be titled <code>8001</code>, the third <code>8002</code>, etc. <strong>Each entry must have a unique title in sequence.</strong></p>
  
  <p><strong>This is the Title Format I tried using:</strong></p>
  
  <p><code>{{ craft.entries.section('scripts').last().title + 1 }}</code></p>
  
  <p>I created a test entry after that and it successfully generated a title similar to the last entry plus one. <strong>However</strong>, when I created a second test entry, the title remained the same as the first test entry, but the slug was <code>titlexx-1</code>. I made another test entry, same thing, with the slug <code>titlexx-2</code>.</p>
  
  <p>What am I missing in my Title Format?</p>
  
  <p>Thanks for the help!</p>
  
Tags: <titles><auto-generate>
Title: Auto-generated title based on last entry
ThreadText: # Auto-generated title based on last entry
  
  (Asked by: username_0 on 2017-06-30)
  
  I am attempting to make one of my sections use auto-generated titles. I am making my first entry with a title like `8000`. What I need is the second entry to be titled `8001`, the third `8002`, etc. **Each entry must have a unique title in sequence.**
  
  **This is the Title Format I tried using:**
  
  `{{ craft.entries.section('scripts').last().title + 1 }}`
  
  I created a test entry after that and it successfully generated a title similar to the last entry plus one. **However**, when I created a second test entry, the title remained the same as the first test entry, but the slug was `titlexx-1`. I made another test entry, same thing, with the slug `titlexx-2`.
  
  What am I missing in my Title Format?
  
  Thanks for the help!
  
  **Tags:** titles, auto-generate
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-06-30. Score: 1 | Accepted answer
  
  Something like this should do what you're looking for:
  
  ```
  {% if not object.id %}{{ craft.entries.section('scripts').order('postDate DESC').first().title + 1 }}{% else %}{{ object.title }}{% endif %}
  
  ```
  
  > **Comments:**
  > **username_0**: Is there a way to make this trigger ONLY when a brand new entry is saved? When the entry is updated and saved the title continues to be changed.  
  > **username_1**: Updated answer...  
  > **username_0**: Amazing. Thank you so much! I had no idea that a field could be so powerful...  
  
  ---
  
  