Skip to main content

Conditional Autonumber? Help!?

  • May 20, 2022
  • 9 replies
  • 150 views

  • New Participant

Hi, thanks for any help anyone can give, I feel like my head is going to explode.

Essentially what I’m attempting to do is have an autonumber generate based on the project it is linked to. I am tracking forms that come in from different projects within the same table.

I need it to work so that If a record is associated with ‘Project 1’ it will generate the next number associated with ‘Project 1’ and if I then create a record associated with Project 2 it won’t carry on from the number generated from the ‘Project 1’ recorded created.

I feel like im explaining this so badly, so if anyone needs further clarification I’m happy to give it. I’m an intermediate user concerning Airtable but this is just baffling me completely!

9 replies

Rupert_Hoffsch1
Forum|alt.badge.img+21

Hi there, if I understand correctly, you need an automation / script which generates an autonumber for different projects in the same table. First record for project 1 → #1. First record for project 2 → #1. Next record for project 1 → #2 etc.

Correct?


  • Author
  • New Participant
  • May 20, 2022

Hi there, if I understand correctly, you need an automation / script which generates an autonumber for different projects in the same table. First record for project 1 → #1. First record for project 2 → #1. Next record for project 1 → #2 etc.

Correct?


Yes, that is exactly what I need, is it possible?


Rupert_Hoffsch1
Forum|alt.badge.img+21

Yes, that is exactly what I need, is it possible?


Of course. Do you have any experience with script writing?


  • Author
  • New Participant
  • May 20, 2022

Of course. Do you have any experience with script writing?


As in writing formulas in Airtable? I would say only just beyond basic. Scriptwriting like coding, no I don’t have any.


Rupert_Hoffsch1
Forum|alt.badge.img+21

As in writing formulas in Airtable? I would say only just beyond basic. Scriptwriting like coding, no I don’t have any.


Ok. Do you have a Pro account?


  • Author
  • New Participant
  • May 20, 2022

I do have a pro account


TheTimeSavingCo
Forum|alt.badge.img+31

I’ve managed to get something similar to work by using the “Find records” automation to look for all the related records, for example “Project 1”, and then updating the field with that value

Consider:
Your table already has two records associated with “Project 1”
You create a record associated with “Project 1”
The automation looks for all records associated with “Project 1” and finds 3 records
The automation updates the record that triggered the automation run with the number 3, which you can get via the length value of the find result

You then create a record associated with “Project 2”
The automation searches for records associated with “Project 2”, and finds 1 record, i.e. the one that was just created
The automation updates the record that triggered the automation with the number 1

Let me know if you end up looking into this and have questions


Kamille_Parks11
Forum|alt.badge.img+27

This issue was covered in the following three posts


Hamlin_Krewson2
Forum|alt.badge.img+8

A conditional autonumber is very achievable with two related tables and zero automation (no need for Pro). You can do this by rolling up the recordIDs (or a UNIX timestamp) of related records, and then searching for the position of that number within that related record. I have more details in the following post.

Make a Tip of the Day to automatically post in Slack