# Help with Invoice number formula

**URL:** https://community.fibery.io/t/help-with-invoice-number-formula/9410
**Category:** Get Help
**Created:** [August 14, 2025, 8:58am UTC](https://community.fibery.io/t/help-with-invoice-number-formula/9410 "2025-08-14T08:58:54Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![Eva\_Folch](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/eva_folch/32/11814_2.png) [@Eva\_Folch](https://community.fibery.io/u/Eva_Folch)
#### Post date: [August 14, 2025, 8:58am UTC](https://community.fibery.io/t/help-with-invoice-number-formula/9410/1 "2025-08-14T08:58:54Z")

</div>

I have this formula on my invoice Database in Coda that automatically creates the invoice number. My format is this one: 207/07/2025 . So the first 3 numbers are increased, and then the month and the year.

In Coda, I have this formula:

**Concatenate((([Invoices DB].[Invoice Number].Last().slice(1,3)) +1 ),“/”, Today().Month().LeftPad(2,0),“/”, Today().Year())**

But because I cannot transform **text to numbers** , like in Coda, I don’t manage to achieve this.

Any ideas how to do this?

Thanks,

Eva

---

<div class="post-metadata">

### Author: ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)
#### Post date: [August 14, 2025, 9:02am UTC](https://community.fibery.io/t/help-with-invoice-number-formula/9410/2 "2025-08-14T09:02:35Z")

</div>

> [@Eva\_Folch](#):
>
> because I cannot transform **text to numbers**

Why do you need to convert text to numbers?

Can’t you just use something like this:

`Middle([Invoice Number],1,3) + “/” + ToText(Month(Today())) + “/” + ToText(Year(Today()))`

?

But be aware, in Fibery Today() is not a static value - it will change every day, causing your formula to update.

Perhaps you want to use a date field (Creation Date?) instead

---

<div class="post-metadata">

### Author: ![Eva\_Folch](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/eva_folch/32/11814_2.png) [@Eva\_Folch](https://community.fibery.io/u/Eva_Folch)
#### Post date: [August 14, 2025, 9:05am UTC](https://community.fibery.io/t/help-with-invoice-number-formula/9410/3 "2025-08-14T09:05:38Z")

</div>

The invoice number is not a number field is a text field, so how can I increase automatically, and add one more when a new row is created?

“Date created” field is a good idea, thanks!

---

<div class="post-metadata">

### Author: ![Eva\_Folch](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/eva_folch/32/11814_2.png) [@Eva\_Folch](https://community.fibery.io/u/Eva_Folch)
#### Post date: [August 14, 2025, 9:09am UTC](https://community.fibery.io/t/help-with-invoice-number-formula/9410/4 "2025-08-14T09:09:43Z")

</div>

> [@Chr1sG](#):
>
> Middle([Invoice Number],1,3) + “/” + ToText(Month(Today())) + “/” + ToText(Year(Today()))

 ![Screenshot 2025-08-14 at 11.08.49](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/9/96119ac3c81a408944e75483c776b084d82fa6ea.jpeg) I get this error…

---

<div class="post-metadata">

### Author: ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)
#### Post date: [August 14, 2025, 9:11am UTC](https://community.fibery.io/t/help-with-invoice-number-formula/9410/5 "2025-08-14T09:11:40Z")

</div>

> [@Eva\_Folch](#):
>
> how can I increase automatically, and add one more when a new row is created?

Well, you have a couple of options: you can either utilise the Public Id field (which is unique and increments each time an entity is created) or you can make an automation rule to write a number field each time an entity is created, and then use ToText on that number when necessary.

Note: due to the way Public Id works, it is not guaranteed to be exactly one higher than the current highest value. See [here](https://community.fibery.io/t/public-ids-numbering-go-in-order-of-entity-creation/2900/2)

---

<div class="post-metadata">

### Author: ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)
#### Post date: [August 14, 2025, 9:14am UTC](https://community.fibery.io/t/help-with-invoice-number-formula/9410/6 "2025-08-14T09:14:54Z")

</div>

> [@Eva\_Folch](#):
>
> I get this error…

I think there is a problem with how discourse renders double quotes in posts.

Try typing them, instead of copy pasting

or use single quotes:

`Middle([Invoice Number],1,3) + '/' + ToText(Month(Today())) + '/' + ToText(Year(Today()))`

---

<div class="post-metadata">

### Author: ![Eva\_Folch](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/eva_folch/32/11814_2.png) [@Eva\_Folch](https://community.fibery.io/u/Eva_Folch)
#### Post date: [August 14, 2025, 9:20am UTC](https://community.fibery.io/t/help-with-invoice-number-formula/9410/7 "2025-08-14T09:20:22Z")

</div>

> [@Chr1sG](#):
>
> Middle([Invoice Number],1,3) + “/” + ToText(Month(Today())) + “/” + ToText(Year(Today()))

Yes, you’re right. Thanks!  
Now I have to figure out how to get the last invoice number. Does the formula Last () work?

---

<div class="post-metadata">

### Author: ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)
#### Post date: [August 14, 2025, 10:53am UTC](https://community.fibery.io/t/help-with-invoice-number-formula/9410/8 "2025-08-14T10:53:00Z")

</div>

If you have a collection field, you can use something like:

`Invoices.Max(Number)`

but Fibery doesn’t allow formula fields to query an entire database.

[![](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/0/022447dfdc766cdbd1c99eb259af4abfcb366b9b.jpeg "Formula fields") ](https://www.youtube.com/watch?v=9Ozqwkk85xs)

[![](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/f/f3daa3069fa396d61588f2d44cf95105d3023415.jpeg "Automation formulas") ](https://www.youtube.com/watch?v=O8mAKN64F6M)

---

<div class="post-metadata">

### Author: ![Eva\_Folch](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/eva_folch/32/11814_2.png) [@Eva\_Folch](https://community.fibery.io/u/Eva_Folch)
#### Post date: [August 14, 2025, 2:15pm UTC](https://community.fibery.io/t/help-with-invoice-number-formula/9410/9 "2025-08-14T14:15:33Z")

</div>

Thank you, Chris! I did not know about these differences in the formula field and rows! 🙂 Yes, I managed with a Rule that increases a number in a Field(Column), and then the name formulas do the rest, adding the “creation Date” field, month, and year!  
Max () worked in the Rule formula!

---

<div class="post-metadata">

### Author: ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)
#### Post date: [August 14, 2025, 9:10pm UTC](https://community.fibery.io/t/help-with-invoice-number-formula/9410/10 "2025-08-14T21:10:09Z")

</div>


