# Incrementing an Existing Sequence Number

**URL:** https://discourse.notenik.app/t/incrementing-an-existing-sequence-number/535
**Category:** Adventures
**Created:** [August 14, 2024, 8:08pm UTC](https://discourse.notenik.app/t/incrementing-an-existing-sequence-number/535 "2024-08-14T20:08:57Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![hbowie](https://discourse.notenik.app/user_avatar/discourse.notenik.app/hbowie/32/6_2.png) [@hbowie](https://discourse.notenik.app/u/hbowie)
#### Post date: [August 14, 2024, 8:08pm UTC](https://discourse.notenik.app/t/incrementing-an-existing-sequence-number/535/1 "2024-08-14T20:08:57Z")

</div>

I’ve talked previously about Automatically Incrementing Sequence Numbers for new notes, using any of several different methods. But what if you want to insert something new in the middle somewhere? Here’s the answer to that problem.

Link: [Incrementing an Existing Sequence Number | Adventures with Notenik](https://notenik.app/adventures/incrementing-an-existing-sequence-number.html)

---

<div class="post-metadata">

### Author: ![benwf](https://discourse.notenik.app/letter_avatar_proxy/v4/letter/b/a183cd/32.png) [@benwf](https://discourse.notenik.app/u/benwf)
#### Post date: [April 17, 2025, 12:25pm UTC](https://discourse.notenik.app/t/incrementing-an-existing-sequence-number/535/2 "2025-04-17T12:25:02Z")

</div>

For me, there is a logical error. Say, I have selected the note with the seq. number 2109, while having a current total of 2118 notes. Creating a new note automatically assigns 2110 (which already exists), but I would expect it to be either set to 2119 (preferred) or, not in this use case but maybe in a Zettelkasten as per a setting, to be 2109.1.

---

<div class="post-metadata">

### Author: ![hbowie](https://discourse.notenik.app/user_avatar/discourse.notenik.app/hbowie/32/6_2.png) [@hbowie](https://discourse.notenik.app/u/hbowie)
#### Post date: [April 17, 2025, 9:59pm UTC](https://discourse.notenik.app/t/incrementing-an-existing-sequence-number/535/3 "2025-04-17T21:59:03Z")

</div>

Notenik endeavors to be both powerful and flexible. So the Seq field can be used to put notes into sequence using any sort of arbitrary value but, by definition, it is not necessarily unique. Nor need it be, in cases where notes are identified based on Title alone, or in combination with a Seq field. So Notenik tries to be helpful, but also tries to avoid presuming too much about what you are trying to do.

However in a case like yours, where you are using a Seq field as the only note identifier, I’ve modified Notenik to keep track of the highest seq value yet used, and then to increment that value when preparing a new note to be filled out.

So try out the [latest beta](https://discourse.notenik.app/t/notenik-16-7-3-available-for-beta-testing-on-april-17th-2025/705) and let me know how this works for you.

---

<div class="post-metadata">

### Author: ![benwf](https://discourse.notenik.app/letter_avatar_proxy/v4/letter/b/a183cd/32.png) [@benwf](https://discourse.notenik.app/u/benwf)
#### Post date: [April 18, 2025, 6:37am UTC](https://discourse.notenik.app/t/incrementing-an-existing-sequence-number/535/4 "2025-04-18T06:37:02Z")

</div>

Ah, this is _very_ interesting and helpful to know (for other collections).

Thanks for the thorough explanation—and quick fix! Will let you know asap.

---

<div class="post-metadata">

### Author: ![benwf](https://discourse.notenik.app/letter_avatar_proxy/v4/letter/b/a183cd/32.png) [@benwf](https://discourse.notenik.app/u/benwf)
#### Post date: [April 24, 2025, 10:09am UTC](https://discourse.notenik.app/t/incrementing-an-existing-sequence-number/535/5 "2025-04-24T10:09:25Z")

</div>

This works very well! Thanks for the quick implementation 🙂
