How can I create the next number automatically?

570
1
12-09-2019 08:26 AM
JoeLivoti
New Contributor III

I've read about the auto-incremenatation issues in the generate ticket number blog. I couldn't solve what I am trying to do.
I am creating a survey that will collect new manholes. This is being done off an existing feature service and all data will be submitted to that feature service. What I am trying to do is to generate an ID based off the last number in our database for the field FACILITYID. It is crucial that there are no duplicated manhole IDs. Any suggestions? Thank you in advance.

-Joe

0 Kudos
1 Reply
by Anonymous User
Not applicable

Hi Joe,

It is not possible using xlsform calculations or pulldata() within the Survey123 field app to be able to query all data in a feature service. Currently only the data within that survey record or from external CSV files on the device can be queried and returned into an input field.

However, we currently have beta support for JavaScript functions in the Early Adopter Community (EAC). Using a JS function it is possible to query a feature service and return a value. This is done using the pulldata(@javascript) function. Many users have already successfully used JS functions to achieve what you are trying to do.

For more information and documentation on how to use JS functions in Survey123, please see the documentation here.

Note this feature is currently in beta and there are some limitations.

Regards,

Phil.

0 Kudos