Back

how to create a generate unique Id ?

  • 0
  • Databases
  • Tools
  • Web
  • Cloud
#fef9ef
14 Aug, 2023, 14:38

hi, I want to generate id like Sale-00001, Sale-00002 where the id of the my sale collection will be reset each time the prefix change. How can do it by tracking existing records and incrementing? Is there any appwrite package to do it easily ? cloud you guy show me the right way ?

TL;DR
The user wants to generate unique IDs in the format "Sale-00001, Sale-00002" for their sale collection. They are looking for guidance on how to track existing records and increment the ID each time the prefix changes. They also ask if there is an appwrite package available for this task. No solution provided.
Drake
14 Aug, 2023, 16:37

You'll have to manage this yourself. maybe fetch the last one and then increment

#fef9ef
14 Aug, 2023, 21:33

@Steven thank you for info.

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more