Hi all,
I have a rather complex issue I'm struggling with. I have a request to build an offline FieldMaps solution to collect culvert line features. These culverts will also have a related table for condition assessments. Due to how the requestor wants their assessment form to look like (one 'select all that apply' type question and several numbers stored as text in likert style) I need to use Survey123 as well. I've attached these apps together via a URL before with success for other projects, but this time it's not working. Ideally, FieldMaps would have support for multiple choice fields and more customization for the look of form itself, but we're not there yet.
I have three requirements for this request that limit my options for the solution overall.
I’ve attached the XLS form I’ve been trying to use and the URL parameters I’m using to pull values from FieldMaps to Survey123 is below.
arcgis-survey123://?itemID=<itemID>&field:GlobalID={GlobalID}&field:Culvert_GUID={GlobalID}&field:ConduitID={Conduit_ID}&field:Material_={Material}&field:Material_Other_={Material_Other}&field:Culvert_Shape_={Culvert_Shape}&field:Culvert_Function_={Culvert_Function}&field:Culvert_Shape_Other_={Culvert_Shape_Other}&callback=https%3A%2F%2Ffieldmaps.arcgis.app%2F%3FitemID%3D4b175a38b5344dd2bf8fa36bef5022bb%26referenceContext%3Dopen
So far I’ve tried:
When I try to use this form as it is now, the culvert GlobalID isn’t being passed through to the assessment repeat neither are ‘some’ of the other culvert field values. Some of them do get passed through. But they’re all configured the same way in the form.
I’m using Survey123 Connect v. 3.19.114, FieldMaps v.24.0.1, and publishing from Pro v. 3.2.0
I guess at the heart of the matter is: Is it possible to reference an entire feature service, both the parent and child layers, within one Survey123 form? How to preserve both the Culvert GlobalID and pass it to the assessment within one form?
Many thanks to any and all advice,
Caitlin
Lane County GIS
I think you may need to remove the {}. Seen it posted a few times and I do not think it is fixed yet.
Me personally i don't use globalids for the key in the relate and it is all so much easier. Plus if you ever move records to SDE later evey thing breaks. I got a some more into here https://community.esri.com/t5/arcgis-survey123-questions/integrating-field-maps-with-survey123-using...
Also I cant tell but maybe you want to grab info from the parent to send to the child from the child record? If so you can use FeatureSetByRelationship in Arcade to query the parent and then pass that in the URL. This does work offline and I use it a lot.
Hope that does it
Why are you passing globalid=Globalid? Not a question in the survey and as far as I'm aware not something we'd want to do.
Are you encoding your URL? The link will have a hard time passing values with spaces or special characters if the URL isn't encoded. You can use Arcade to do this.
https://developers.arcgis.com/arcade/function-reference/text_functions/#urlencode
Thank you both very much Doug and Christopher, I tried using your advice but still not having any luck.
@ChristopherCounsell I was seeing odd behavior of the survey creating new, null geometries in my culvert line layer and attaching the related assessment record to that instead of the correct feature. So to troubleshoot, I tried passing feature's GlobalID through the URL to see if that would work. It did not.
@DougBrowning I also tried following the links you sent and set up an Arcade expression to build and encode the URL that way and have it scrape away the {} from the GlobalID, and after splitting the Concatenate in two I was able to test it. Unfortunately it still isn't pulling over any information from the parent culvert layer including the GlobalID.
My Arcade expression to build the URL is below. I needed to perform some IF statement checks to ensure null values weren't trying to be sent through in the URL and then adding a couple more Concatenates to ensure everything was pieced together correctly. As an aside, I noticed that Concatenate only works for three inputs at a time. After some testing I found that the GlobalID was being sent from FieldMaps to Survey123 correctly without needing to scrape out the {}, so maybe ESRI started making improvements on it?
var S123urlsource = 'arcgis-survey123://?itemID=ITEMID&field:Culvert_GUID='+$feature.globalid+'&field:Culvert_Function='+$feature.Culvert_Function+'&field:Material='+$feature.Material+'&field:Culvert_Shape='+$feature.Culvert_Shape+'';
var materialcheck = IIF($feature.Material_Other!=null,Concatenate(S123urlsource,'`&field:Material_Other='+$feature.Material_Other+``),'')
var shapecheck = IIF($feature.Culvert_Shape_Other!=null,Concatenate(S123urlsource,'`&field:Culvert_Shape_Other='+$feature.Culvert_Shape_Other+``),'')
var callback = '&callback:submit='
var FMurlsource='https://fieldmaps.arcgis.app?';
var FMparams='itemID%3DITEMID%26referenceContext%3Dopen%26featureSourceURL%3Dhttps://services1.arcgis.com/FNSBkbt9MsC1V9Cx/arcgis/rest/services/Culvert_Inventory_and_Assessments/FeatureServer%26';
var appendchecks = Concatenate(S123urlsource,materialcheck,shapecheck)
var firstpart= Concatenate(appendchecks,callback,UrlEncode(FMurlsource));
var final = Concatenate(firstpart,FMparams)
return final
But unfortunately I've run out of time to dedicate towards figuring out how to have both the parent and child fields in the Survey form, so I had to re-create everything in order to have something working quickly. I now have it working by having only the related Assessment fields were in the survey form then duplicating some of the culvert fields into the related Assessment table and converting my "select all that apply" requirement into several Yes/No fields.
It's not my ideal solution, but it gets staff out into the field to begin data collection.
Again thank you both for your insights and advice, I really appreciate it!
I hope to one day be able to revisit this and really dive into how to get it to work.
Caitlin
Caitlin it sounds like you are trying to edit the existing feature.
Survey123 was originally designed to collect new data. Only later was the ability to edit existing records added, using the Survey123 inbox.
You have two options.
Have the survey target the related table only. Use the form_id in settings. Launch the survey off the parent feature, passing the globalid into the parentglobaldid question. This will store records in the related table of the parent feature. It won't update the parent. You could use ArcGIS Notebook scripts or another process to push the info back to the parent.
The second option is to use the Survey123 Inbox. You'll need to set this up on your survey, enable sync on your later. Then launch the survey with url parameters to open the existing record directly in the inbox. This method updates both directly but does not support field value parameters from the popup. Images also won't go offline in survey123. Here's a link to another post with the arcade expression: