# Auto Number Generation

**URL:** <https://forum.adalo.com/t/auto-number-generation/702>\
**Category:** Get Help\
**Created:** [April 12, 2020, 3:33pm UTC](https://forum.adalo.com/t/auto-number-generation/702 "2020-04-12T15:33:49Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![zensiblesolutions](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/zensiblesolutions/32/286_2.png) [@zensiblesolutions](https://forum.adalo.com/u/zensiblesolutions)\
**Post date:** [April 12, 2020, 3:33pm UTC](https://forum.adalo.com/t/auto-number-generation/702/1 "2020-04-12T15:33:49Z")

</div>

Is there away to populate a field with a unique number i.e order number/Contract Number?

---

<div class="post-metadata">

**Author:** ![Ben](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/ben/32/9_2.png) [@Ben](https://forum.adalo.com/u/Ben)\
**Post date:** [April 12, 2020, 11:47pm UTC](https://forum.adalo.com/t/auto-number-generation/702/2 "2020-04-12T23:47:35Z")

</div>

Yes! First, make sure you collection has a number property.

Then, you can have an action to create a new item in the collection. For the number property in that action, you can set the value to be “{Collection\>Count} + 1”

---

<div class="post-metadata">

**Author:** ![ahmedferdaus](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/ahmedferdaus/32/355_2.png) [@ahmedferdaus](https://forum.adalo.com/u/ahmedferdaus)\
**Post date:** [April 13, 2020, 3:30am UTC](https://forum.adalo.com/t/auto-number-generation/702/3 "2020-04-13T03:30:47Z")

</div>

Hi Ben,  
Is the same process if I want to create user ID for newly registered user?

---

<div class="post-metadata">

**Author:** ![Ben](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/ben/32/9_2.png) [@Ben](https://forum.adalo.com/u/Ben)\
**Post date:** [April 13, 2020, 2:57pm UTC](https://forum.adalo.com/t/auto-number-generation/702/4 "2020-04-13T14:57:20Z")

</div>

Yep, that’s right; it is!

---

<div class="post-metadata">

**Author:** ![pacorro](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/pacorro/32/4209_2.png) [@pacorro](https://forum.adalo.com/u/pacorro)\
**Post date:** [December 4, 2020, 4:01pm UTC](https://forum.adalo.com/t/auto-number-generation/702/5 "2020-12-04T16:01:21Z")

</div>

Hi @Ben … following on this topic…I was trying to implement an automatic order number generator and this method works just fine, but what if I want to delete/cancel an order? lets say I delete/cancel order 98 out of a 100 already made and I’d like to continue the same sequence… this method would duplicate order number 100 once I try to create order “101”. Is there a way to find the Max value of a field in my database? in this case the Order ID field. This way we could implement a Max+1 logic right?

---

<div class="post-metadata">

**Author:** ![Victor](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/victor/32/2054_2.png) [@Victor](https://forum.adalo.com/u/Victor)\
**Post date:** [December 4, 2020, 4:55pm UTC](https://forum.adalo.com/t/auto-number-generation/702/6 "2020-12-04T16:55:01Z")

</div>

Hi @pacorro,

I think you can get “Maximum” for a property of Numeric type in a collection.

From other point, I prefer not to delete records like orders in the collection, but rather mark them “cancelled”, “abandoned”, etc.

Best,  
Victor

---

<div class="post-metadata">

**Author:** ![pacorro](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/pacorro/32/4209_2.png) [@pacorro](https://forum.adalo.com/u/pacorro)\
**Post date:** [December 4, 2020, 5:17pm UTC](https://forum.adalo.com/t/auto-number-generation/702/7 "2020-12-04T17:17:29Z")

</div>

Thank you @Victor…I just found this topic with the solution ([Auto generate a UserID when a user signs up to my app](https://forum.adalo.com/t/auto-generate-a-userid-when-a-user-signs-up-to-my-app/5866))…I was thinking about deleting records to save space in case I have images, videos and such in said records.
