Auto increment ID not working

Hi there,

I have a table where I am registering some orders added by users through the UI.
I am sort of faking an ID for each order by trying to use the following formula to always generate the latest ID + 1:

{{quotes.data==null ? 0 : parseInt(Math.max(quotes.data.id))+1}}

However, at each run, all I get is the id = 0, I however do see there are new rows in the .id attribute being generated:

I have also just recently tried a different approach:

{{quotes.data==null ? 0 : quotes.data.id[5]+1}}
The above calculation works when I use the 5th position of the id array, but when I try and replicate the same value with the following calculation, I get "undefined":

{{quotes.data==null ? 0 : quotes.data.id[quotes.data.id.length-1]+1}}

When I evaluat this individually:

quotes.data.id.length-1

The result is a number with the value 5, so theoretically this should work no?
Perhaps I am missing something?

Just to make sure, quotes here is the query not the table right?

I'm assuming the query returns an array of records, try:

formatDataAsObject(query.data).id