Hi, I am a newbie to Knack trying to migrate a Caspio app.
In this app I need to have a unique identificator for a table in the form
-9999 where
are the last two digit of year
9999 is an autoincrement number that start from 1 and is resetted every year.
Searching into this forum I found the post of @JoshCooper69932
that is similar, but with a different reset logic.
Anyone can give me a hint?
Pretty Sure I could answer your question if I could understand it. The explanation of your problem just doesn’t really make any sense.
Please re-phrase and I’ll give you the Answer.
Hi @Justin11773, you are right, my description was corrupted and incomplete!
I need to have a field with a unique code with this appearance:
YY-9999
where
- YY are the last two digits’s year
- 9999 is a kind of autoincrement number restarting every Year
Do you have any idea? It is really the killer feature allowing me to migrate the apps of a customer of mine…
There may be a better way to do this, but the first thing I would try is: creating the fields with the the data you need (auto increment and date fields) then use text formula fields to snip and merge them however you like. Then use a scheduled task to reset the autoincrement field to 1 each year.
[EDIT] there doesn’t appear to be a yearly trigger for the scheduled task, so that may not work. There are some pretty brilliant people in this community, so I’m sure someone can chime in for ya.
Here is a low tech all Knack solution. You can use parts of this in conjunction with knack flows, make or some js to make it simpler and smoother. Feel free to reach out to my team on the knack expert forum, the make partner directory or n Upwork if you need help with your database or automations in the future. : ) Justin -Automaton Solutions. Solving Auto-Increment Field Challenges | Loom
It is quite interesting, but I do not understand (sorry for my low knowledge) where did you find the Max datatype referenced in the video at 00:41 may be it is some plan-related feature?
EDITED: sorry, found it! I was looking in the wrong place
Max will return the highest number from that field on any connected object. In this case it will always be the last auto-increment value created. You need this number so that you can transfer it to the adjustment field once a year and reset the final portion of your text formula back to ‘1.’ Of Course, this whole thing is way simpler to do on make.com and could probably be handled on their free plan.
Oh. Sorry. Just re-read. Max is an option when selecting field types. Just look for it when adding a new field.
Yes but I discovered after that it appears only for tables with connections ![:slight_smile: :slight_smile:](https://emoji.discourse-cdn.com/apple/slight_smile.png?v=12)
yes. You need to create a connection on the child record to the parent. Many children connect to one parent ( The table with the Max field)