Hello all,
I am using the solution suggested by Ismael in this post to calculate the next highest value in the idlong field.
There are no error messages but the value that is being produced is 401 (in ArcGIS Survey123 Connect) instead of 18320972.
Any clue what I could be doing wrong?
Thanks for your help!
Something else you could try:
pulldata("@layer", "getValue",""attributes.<idlong>", "<url> ?orderByFields=<idlong> DESC"
This should sort greatest to least and return the greatest.
Survey123 Tricks of the Trade: pulldata("@layer") - Esri Community
You can replace the pulldata (@javascript) function with it. And obviously update the <xyz> with your appropriate info.
Whats your full pulldata() calculation? or can you share your xlsx example?
What is the attribute name of the field in your feature service that contains the idlong data. In your pulldata @javascript function you are referenceing ${idlong} which you are calculating with the results. The results of the calculation should return a number and not a field name. probably why it is returning 401, because it is a cyclic redundancy. You should hardcode that field name from your feature service instead of referencing a question.
I still think you could try using this by replacing "<idlong>" with your field name that contains the idlong data your are trying to return.
pulldata("@layer", "getValue",""attributes.<idlong>", "https://arcgissvr.borough.carlislepa.org/server/rest/services/Hosted/DataCollectionInspection/FeatureServer/0?orderByFields=<idlong> DESC"
Hope that makes sense.
Right here:
instead of calling a question from the form. insert the name of the field in your feature service corresponding to the idlong data. so instead of ${idlong} to would be "idlong" assuming that is your field name.
or in the pulldata @layer it would be:
pulldata("@layer", "getValue",""attributes.idlong", "https://arcgissvr.borough.carlislepa.org/server/rest/services/Hosted/DataCollectionInspection/FeatureServer/0?orderByFields=idlong DESC")
again assuming idlong is the field name in the feature service.