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.
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.
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.