I was hoping that importing data would auto-generate/increment the ID column but it doesn't (unless I'm mistaken?)
So I wrote this function in Excel VBA to generate a random string for the "id".
Usage: (in Excel column)
Function MakeApperyID(length As Integer) As String
' create a id string of "length" chars using 0-9 and a-f only
' in keeping with Appery DB _id format you could call this
' with length 4 to create a starting 4 char sequence in a fixed cell location
' and then add that to a length 20 call to create the remainder of the ID
Code: Select all
Dim Result Dim i, j, k Dim ch Randomize (Now) Result = "" For i = 1 To length k = CInt(Rnd()) 'zero or one to decide on letter or number If k = 0 Then j = CInt(Rnd() * 5) ch = Chr(j + 97) Else j = CInt(Rnd() * 9) ch = Chr(j + 48) End If Result = Result + ch Next MakeApperyID = Result
Feel free to use, amend and feedback any useful changes.