Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Airtable Community
- Discussions
- Ask A Question
- Formulas
- Using Formula to Create Autonumber

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Topic Labels:
Formulas

Solved

Jump to Solution

0
11360
9

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Comment Post Options

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

May 21, 2020 08:16 AM

Is there a sequential order when a new record is created through a Form view? Can you define/control the order?

Solved! Go to Solution.

1 Solution

Accepted Solutions

Solved
See Solution in Thread

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

May 21, 2020 09:57 AM

I *think* the answer here is yes, based on what you are saying and the formula you showed us. I’m not sure what your `{Leading Zeros}`

field is holding, but I assume it’s just a number representing the total length you want the numeric portion of your ID’s to be.

So if you want the numeric portion of your ID’s to always be 5 digits long…

```
00001
00002
02308
etc...
```

then you can just replace that reference to `{Leading Zeros}`

with the number 5 – your formula will continue to behave the same way.

Is that what you were asking?

Reply

9 Replies 9

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

May 21, 2020 08:29 AM

Welcome to the community, @Paul_Dezzutto!

Yes, there is an autonumber field type that you can choose.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

May 21, 2020 08:54 AM

When a user submits a new record via a form view, the formula does pick up the 'Leading Zeros value. Can I set a static value for the Leading Zero in the formula?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

May 21, 2020 09:30 AM

No, unfortunately, Airtable does not support static values (aka “global values” in other programming languages).

What are you trying to do? Just trying to set a certain amount of leading zeroes in your formula?

Solved
See Solution in Thread

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

May 21, 2020 09:57 AM

I *think* the answer here is yes, based on what you are saying and the formula you showed us. I’m not sure what your `{Leading Zeros}`

field is holding, but I assume it’s just a number representing the total length you want the numeric portion of your ID’s to be.

So if you want the numeric portion of your ID’s to always be 5 digits long…

```
00001
00002
02308
etc...
```

then you can just replace that reference to `{Leading Zeros}`

with the number 5 – your formula will continue to behave the same way.

Is that what you were asking?

Reply

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

May 21, 2020 10:54 AM

Yep, exactly. Works like a charm even with the form submissions.

Thanks @Jeremy_Oglesby

Reply

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

May 22, 2020 10:00 AM

This would be helpful for something I am doing, but obviously I’m missing something.

How are you creating the Autonumber field? That has to be a string and not a number in order to use the LEN formula, right?

Thanks.

Paul

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

May 22, 2020 10:15 AM

The Autonumber field is just that - an Autonumber field. Its value is an integer produced automatically, sequentially, and which cannot be edited.

In @Paul_Dezzutto’s formula, he is able to use the `LEN()`

function on the Autonumber field because he is *coercing* the integer returned by that field into behaving like a string by concatenating it with an empty string inside the `LEN()`

function.

Here’s his formula:

```
'EV-' &
REPT(
'0',
{Leading Zeros} -
LEN({Autonumber} & '')
) &
{Autonumber}
```

Notice that inside the `LEN()`

function he has `{Autonumber} & ''`

– that `& ''`

is concatenating an empty string onto the end of the integer returned by `{Autonumber}`

, and doing that forces that integer into behaving like a string when it gets evaluated by `LEN()`

. So `LEN()`

is ultimately getting the length of the value in the `{Autonumber}`

field if it were a string.

Reply

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

May 22, 2020 11:27 AM

Reply

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

May 22, 2020 11:28 AM

But I can see the application where the number of digits would increase or decrease.

Reply