Auto Number Column Duplicating
Good Morning,
I have an automation setup for when an individual orders an XL the row duplicates for the Standard size along with the XL.
What I cant figure out is why my auto number duplicates instead of applying the next auto number.
In the screen shot below you will see that the third row is a duplication of the second row however one row is for an XL blood pressure cuff and one is for a standard cuff. I am not able to figure out why the auto-number is duplicating for these instances.
Answers
-
Smartsheet only allows for one auto number column. You can essentially create your own custom auto number column with a formula like this:
=[Order Number]@row + " " + COUNTIF([Order Number]:[Order Number], <> "")
When a new row is created, it will assign a custom sequential order number, based on the [Order Number].
The only issue with this, if you have multiple rows being created at the same time, it will calculate their order number as the same (such as automation moving rows into a sheet)
Sincerely,
Jacob Stey
-
@SteyJ That is actually how it is setup, the "Order Number" is a system auto-number column and the "Master Order Number" column is a formula based column for sequential ordering. I am not able to figure out why the system auto-number column is duplicating the "Order Number"
-
I see. Try verifying that the Order Number column didn't change to a text/number type, and verify there isn't another column that has changed to auto-number
Sincerely,
Jacob Stey
-
@SteyJ It is still set as auto-number, the auto-number transfers in from other sheets. There are 9 sheets which transfer into the master sheet, each of them have the auto-number setup and it transfers into the master sheet.
-
Hi, @CaraBart28 , as you have discovered, an auto number does not change, and is unique only within the sheet that it is created. When setting it up, you can configure a prefix or suffix for the auto-number column. However, doing so changes the "auto-number" to a string and prevents you from using numeric functions directly on the value (e.g., MIN(), MAX(), and others).
Here's one approach if you have a small, manageable number of rows in the master sheet. It requires minimal changes to your collection of sheets.
- Create a Text/Column named Sheet # in all of your 9 source sheets . In the first sheet, place the column formula
=1
;=2
in the second sheet;=3
in the third sheet; and so on. - Create the Sheet # column in the master sheet, too.
- For every row in the master sheet, figure out in which sheet the row was originally created and enter the sheet number into Sheet #. If it is too time consuming, simply ensure that all of the rows with the "duplicate" auto-number have a different number in the Sheet # column.
- Place the column formula below into the Master Order # column.
- Done!
=IF(AutoNumber@row = MIN(COLLECT(AutoNumber:AutoNumber, AutoNumber:AutoNumber, @cell <> "")), 1, 1 + COUNTIF(AutoNumber:AutoNumber, <AutoNumber@row) + COUNTIFS([Sheet #]:[Sheet #], <[Sheet #]@row, AutoNumber:AutoNumber, =AutoNumber@row))
Here's how the formula works...
If the auto-number for the row is the MIN(), then its master order number is 1. If not, then the master order number is...
Add 1 to the count of rows with an auto-number less than the current row AND add (the count of rows that have the same auto-number as the current row and whose sheet # is less than that of the current row).
This approach leverages the fact that other sheets in the collection may create the same number, but each sheet will create that auto-number just once.
- Create a Text/Column named Sheet # in all of your 9 source sheets . In the first sheet, place the column formula
-
=1 + COUNTIF([Date Request form Submitted]:[Date Request form Submitted], <[Date Request form Submitted]@row)
@CaraBart28 , as it happens, there's an even simpler approach if the column Date Request form Submitted is the Created date column. If it is, then use the formula above.
No other changes to your sheets are necessary.
The created date value is a system timestamp, and is granular to the second--maybe millisecond, too. While not displayed in the cell, the second/millisecond granularity allows us to find the order in which the rows were created. That's what the formula above does.
-
@Toufong Vang Thank you for your help. I added the above reference formula, however it is still giving duplicate numbers. Please see the screen shot below.
-
@CaraBart28 Wow...that means that those are in fact duplicates OR they happened to be created at exactly the same moment in the system OR the Smartsheet system timestamp is not as granular as is needed by the approach.
Since using the Created Date alone doesn't work, try the first method of using a helper Sheet # column along with the auto-number column. (First suggestion above--posted on 12/28.)
-
@Toufong Vang I am getting the unpears when entering in the formula, i might be missing something?
=IF(AutoNumber@row = MIN(COLLECT(AutoNumber:AutoNumber, AutoNumber:AutoNumber, @cell <>"")), 1, 1 + COUNTIF(AutoNumber:AutoNumber, <AutoNumber@row) + COUNTIFS([Sheet #]:[Sheet #], <[Sheet #]@row, AutoNumber:AutoNumber, =AutoNumber@row))
-
@CaraBart28 Hmm...ensure that you have the necessary columns for the formula to work.
If your auto-number column is not named "AutoNumber", then replace AutoNumber@row and AutoNumber:AutoNumber with the name of the column in your sheet.
Also, the formula requires a column named Sheet #, and it must have a numeric value.
-
@Toufong Vang I corrected the formula so that it reflects the column name "Order Number" However I am still not getting a sequential order or numbers.
-
@CaraBart28 The first solution requires that each sheet has the column formula ="1" for sheet #1, "=2" for sheet #2, "=3" for sheet #3, and so on. As a result, when the copied rows get transferred into the master sheet, you may have duplicate order numbers, but only one combination of sheet # and order number.
If your workflow/process permits a row to be routed/moved back to the sheet that originally created the row, then you will need to use the Modified Date column type instead of the "Date Request form Submitted" in the formula for the second solution (post from 12/29/2023).
-
@Toufong Vang I did try the second route, however, I used data mesh as an automation to load data back into the master sheet and when that happens the modified date for the original and duplicate row are the same so therefor it will not provide me with a unique identifier.
-
@CaraBart28 I haven't used DataMesh. Instead of copying/duplicating the entire row, will DataMesh allow you to leave a few columns empty (unmapped)? If so, then leave the Created Date and Modified Date timestamps blank; and leave the auto-number column blank, too. When the sheet is refreshed, these fields will be filled-in by Smartsheet, thereby making them different from that of the original row.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 63.5K Get Help
- 402 Global Discussions
- 213 Industry Talk
- 450 Announcements
- 4.7K Ideas & Feature Requests
- 141 Brandfolder
- 135 Just for fun
- 56 Community Job Board
- 454 Show & Tell
- 31 Member Spotlight
- 1 SmartStories
- 296 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!