After hours of trying I think I know the answer but I wanted to check.
I finally got a callback URL (that double encoding is lots of fun) to work once I switched to hardcoding the values. There are no help samples of this.
Here is my sample hardcodeing the callback values and feature globalid
arcgis-survey123://?itemID=9269d29cfc994accb9c3739c556ee345&field:LOCAL_ID={LOCAL_ID}&field:GeoGUID={globalid}&callback=https%3A%2F%2Ffieldmaps.arcgis.app%3FitemID%3D60898699d9194370985ba5d1b88ac966%26referenceContext%3DupdateFeature%26featureSourceURL%3Dhttps%3A%2F%2Fservices1.arcgis.com%2FHp6G80Pky0om7QvQ%2Farcgis%2Frest%2Fservices%2FPFCRCTest4%2FFeatureServer%2F0%26featureID%3D431c51d1-2570-4677-a13e-4a42d582cf66%26featureAttributes%3D%257B%2522LOCAL_ID%2522%3A%2522testhardcode%2522%2C%2522FormGUID%2522%3A%2522hardid%2522%257D
But what I would like to do is pull a field back from 123. I am doing this to link the forms in both directions. I want to send back a guid that I generate in 122.
I have tried this (unencoded). Just the callback part works from 123 so I got that part right and I can use 123 fields just fine.
arcgis-survey123://?itemID=9269d29cfc994accb9c3739c556ee345&field:LOCAL_ID={LOCAL_ID}&field:GeoGUID={globalid}&callback=https://fieldmaps.arcgis.app?itemID=60898699d9194370985ba5d1b88ac966&referenceContext=updateFeature&...${LOCAL_ID}%22,%22FormGUID%22:%22${FormGUID}%22%7D
I have a feeling that the callback URL is hard generated at the time of the call in Field Maps. That means referencing a field in 123 with ${LOCAL_ID} makes no sense since you are in Field Maps at the time the URL is generated. Am I right?
If I am in right is there any way to send data to 123 via a URL then use callback to send 123 data back in to Field Maps?
thanks for any help
Not seeing this covered still looking thanks
https://doc.arcgis.com/en/survey123/reference/integratewithotherapps.htm
Hi Doug,
I stumbled across your post after looking into the use of url callbacks. I agree the ability to send data back from Survey123 would be great. After reading your post and a lot of tinkering with the encoding I at least managed to set up a system where once the survey has been completed the callback goes back to the polygon layer and updates a status field to indicate that the associated survey has been completed for that particular polygon. My hope is that this will help our surveyors keep track of which features they've fully completed. Plus with the new filter options in Field Maps it means they can filter to show those they've missed.
So I'm not really offering anything new to the conversation but just wanted to say thanks as your post convinced me that more complex call backs are possible! Cheers
Cool can you post a sample? My guess is you could hardcode the data somehow.
Sure. My url is generated in Arcade, see below. You can ignore most of it but I spent a long time trying to get the callback variables to work. Basically I found that if I included my callback variables in a parameters dictionary as I've done for the survey123 parameters and then used the UrlEncode function, Field Maps didn't appear to like that and kept telling me that I needed to supply the featureID parameter despite it being there in the url. I ended up realising that Field Maps doesn't like any ampersands after the callback which is why I've had to encode these manually rather than using the UrlEncode function on the parameters dictionary, which kept adding the ampersands back in.
The callback part of my script could probably be written a bit more elegantly as I'm still fairly new to Arcade but this worked so I didn't want to mess with it too much! Like you say it would be great to pull data back from S123 in the callback but I was at least glad to be able to get it to update the layer in Field Maps once the form had been completed. The only thing I don't like is that when it goes back to Field Maps the updateFeature element reopens the form and it'd be great if it just wrote "Yes" to the field without the form being opened again, to avoid the surveyor changing anything else by accident.
Don't know if that's of any of use but just wanted to acknowledge your post as it was the first thing I'd seen that suggested additional callback parameters may be possible. Cheers
Would your process work if I have a public S123 that goes into webmap which lunches internal S123 for inspection. Any help in how to set this up and be able to pass parameter between the collected information in the first survey and the second survey.
Thanks
Yes you can use a URL to launch a form the same way as you do in field maps, no different. Just make a note field and have the link in the label part.
So i am able to lunch the second s123 with the correct globalid in the url what i don't know how to do is store that information on a field called ParentID.
Amazing - this has been good to dabble with - my issue is that I can't get the last section for call back attributes changing
//Launch survey123
var urlsource ="arcgis-survey123://?itemid=XXXXXX&";
//Generate other url parameters to pass to survey123
var params = {
"field:SubmittingGlobalID": $feature.GlobalID,
"field:NAQSActivityCodeTemp": $feature.ReviewedSurveyID,
"field:Starting_survey_ID": $feature.First_specimen,
"field:AnimalType": $feature.SurveyType,
"field:SpeciesUnderInvestigation": $feature.CommonName,
"field:Feral_Group_ID": $feature.Group_ID,
};
var callback = {
callback: "https://fieldmaps.arcgis.app/?referenceContext=updateFeature&itemID=XXXXXXXX&featureSourceURL=XXXXXX...",
}
var callbackid = "featureID=" + GlobalID
var callbackattributes = 'featureAttributes={"SampledGroup":"Yes"}'
return urlsource + UrlEncode(params) + "&" + UrlEncode(callback) + "%26" + UrlEncode(callbackid) + "%26" + UrlEncode(callbackattributes)
When I use this approach, I can go to survey123, plug my data in and then return back to the app, but the callback attributes just doesn't work, just lands on field maps with the old pop up. Seeking even a suggestion that opens up the form at attribute that needs to be filled in
I'm having the same problem. Can call Survey123, pass attributes and centroid Lat/Long for geopoint creation, but upon returning to Field Maps, it just shows the popup. No edit pane or fields updated. Trying to update a field with the date and time that the survey happened via Now() in my Arcade URL generation .