brand new to App Maker (loving it). I need help to create a auto-number field, so my App can be referenced by a uniqueID. My previous app used Sheets and I was able to compile a script that got the lastvalue and added 1 for each new record. Here was my old code:
var SS = SpreadsheetApp.openById(Key).getSheetByName('Data');
var LR = SS.getLastRow();
var SC = SS.getRange('A1').getValue();
if(! SC){SS.getRange('A1').setValue(1);return};
var colValues = SS.getRange('A1:A').getValues();
var CNT=0;
for(var r in colValues){
if(Number(colValues[r][0]>CNT)){CNT=colValues[r][0]};
} CNT++ ;
var setCID = SS.getRange('a1').offset(LR, 0);
So if the Previous Clinic ID was 27, setCID would be 28
Cant seem to find anything about this. Can anyone guide me using AppMaker as this obviously wont work. Thanks. Deryk