Access data in data base

Hello,
I don't find auto-incrementation function in my research. and I want to know if it's possible to access the data which stoked in data base.

For example, I collect data in the form id=4. I start a new form and I want to know the value of id of last finalized form(id=4) to calculate the id of new form (id = id_last_form +1).

This situation is it possible ?

Thanks for you work.
Benjamin NATIVEL

To be clear, are you trying to generate a unique id for an entirely new
form, or for a new submission (for an existing form)?

  • Gareth
··· On Monday, May 8, 2017 at 7:57:21 PM UTC+12, Ben nat wrote: > > Hello, > I don't find auto-incrementation function in my research. and I want to > know if it's possible to access the data which stoked in data base. > > For example, I collect data in the form id=4. I start a new form and I > want to know the value of id of last finalized form(id=4) to calculate the > id of new form (id = id_last_form +1). >

I want to generate a unique id for a new form.

··· Le mardi 9 mai 2017 01:42:19 UTC+4, xiph...@gmail.com a écrit : > On Monday, May 8, 2017 at 7:57:21 PM UTC+12, Ben nat wrote:Hello, > > I don't find auto-incrementation function in my research. and I want to know if it's possible to access the data which stoked in data base. > > > > For example, I collect data in the form id=4. I start a new form and I want to know the value of id of last finalized form(id=4) to calculate the id of new form (id = id_last_form +1). > > > > To be clear, are you trying to generate a unique id for an entirely new form, or for a new submission (for an existing form)? > > - Gareth

There's nothing in the client-facing Aggregate API by which to discover
what the last uploaded form is. You'd actually have to download all the
forms and parse their upload timestamp out of the received XML, and sort to
determine the most recent one.

Probably your best bet will be to fetch the current formlist and use that
to generate a unique id for your next form (and hope nobody else happens to
upload a form which collides, which could be a risk if you are all calling
them "form1", "form2", "form3"...)

  • Gareth
··· On Tuesday, May 9, 2017 at 4:41:46 PM UTC+12, Ben nat wrote: > > Le mardi 9 mai 2017 01:42:19 UTC+4, xiph...@gmail.com a écrit : > > On Monday, May 8, 2017 at 7:57:21 PM UTC+12, Ben nat wrote:Hello, > > > > I don't find auto-incrementation function in my research. and I want to > know if it's possible to access the data which stoked in data base. > > > > > > > > For example, I collect data in the form id=4. I start a new form and I > want to know the value of id of last finalized form(id=4) to calculate the > id of new form (id = id_last_form +1). > > > > > > > > To be clear, are you trying to generate a unique id for an entirely new > form, or for a new submission (for an existing form)? > > > > - Gareth > > I want to generate a unique id for a new form.