Trouble with setting up serial numbers for table IDs

Hi @lflaherty,
Using a variable to track the build number is not reliable so i will stay clear of that method.

What I suggest is :
Store the serial number in a table. (If you have not done it already)
Run a table query for the date created. The date will be supplied as an app input.

Sort the results “new to old”

Limit the results to 1. This way we get the most recent serial number for that day. If no serial numbers were created that day then there are no results. Then you know you have to start numbering from the beginning.

Create a table aggregation to retrieve the result

In the app create a trigger to store the table aggregation result.
Then use a combination of TEXTTOINTEGER(), MID() or TRIM() in the expression editor to extract just the number and then add one to that.
Technical Details of the Expression Editor (tulip.co)

Sorry for the very high level explanation but the info on this thread give you more info. There is a youtube vid there as well.
Using Table Aggregations to auto-increment ID - Show and tell - Tulip Community

There are other discussions in the community about using Table APIs. But IMHO that is not required for your application.

1 Like