Hello - I have created a field maps app based on a feature service that has several layers and related tables. One of the feature layers is called PlantedArea (polygon feature layer). In Field Maps, the users would create a polygon to delineate the area where marsh plantings were installed in an area. The feature layer has a PlantedAreaType subtype field where 1 = Low Marsh and 2 = High Marsh. I want to use a Survey123 form for users to fill out the information for the Planted Area polygon since I want to have the ability for the user to select multiple answers and other survey123 form options. I want to be able to use the Survey123 form to edit the existing feature layer. I created a URL in my field map feature layer popup for passing the values of fields in the field map feature layer to the survey123 app and the answers in the Survey123 app to populate the field maps feature layer. I added edit to the URL since I want to be able to edit the feature layer with the values inputted into the Survey123 App. I want the existing fields in the field maps feature layer to populate in the Survey123 form so that the user doesn't have to enter these values again and so that the survey123 form shows the correct questions based on the PlantingAreaType (Low Marsh or High Marsh) of the feature.
Currently, a user creates the polygon, selects which PlantedAreaType subtype (Low Marsh or High Marsh) and hits submit to create the polygon. Once the polygon is created, the Survey123 form pops up. However, the PlantedArea information of the current feature is not passed to the survey.
My URL: href="arcgis-survey123://?itemID=f6a81fd0394a428da2885143cf6c0016&field:GlobalID = {GlobalID}&field:PlantedArea_GUID={PlantedArea_GUID}&field:PlantingAreaType = {PlantingAreaType}&field:Shape__Area={Shape__Area}& field:Shape__Length={Shape__Length}& field:DatePlanted={DatePlanted}&field:PlantedPhase={PlantedPhase}&field:PlantingCoverage={PlantingCoverage}&callback=https%3A%2F%2Ffieldmaps.arcgis.app&mode=edit"
After creating a PlantingArea feature, a record is created with the fields entered in Field Maps App (PlantedAreaType, GlobalID, PlantedArea_GUID, Shape_Area, Length_Area) in the data table. After submittal, the Survey123 app pops up with no values passed. Any information filled in on the Survey123 form creates a new record in the data table with a new GlobalId (but the PlantedArea_GUID is filled in and the same) and no fields are filled whose values are on the feature layer. I want the survey to edit the existing feature layer, not create a new record.
What am I doing wrong?
Thank you!!
Solved! Go to Solution.
Hello - I wanted to thank you for taking the time to help. I ended up getting a ticket with ESRI and they solved the issue. This is the following URL that does the job: href="arcgis-survey123://?itemID=47a103b3abc04c05be8a1088b8a5a7f4&folder=inbox&update=true&action=edit&q:GlobalID={GlobalID}&field:PlantingAreaType={PlantingAreaType}&callback=https%3A%2F%2Ffieldmaps.arcgis.app"
Hi,
maybe you need to switch the "edit" in the URL and from my understanding passing the GlobalID of the polygon is enough since the data are already in the attributes of the polygon.
Maybe try this url: href="arcgis-survey123://?itemID=f6a81fd0394a428da2885143cf6c0016&mode=edit&globalId={GlobalID}&callback=https%3A%2F%2Ffieldmaps.arcgis.app%2F"
Thank you. I used your recommended URL and a new record is created in my attribute table providing a NEW Global ID and populates the fields entered into my survey but no data from the feature layer is passed.
When a polygon feature is created in my Field Maps app, a record in the attribute table is created that includes a GlobalID, a GUID (the polygon is a related feature of another polygon layer), my subtype integer field (PlantingAreaType), Shape_Area, and Shape_length. Once Submit in Field Maps is clicked to create the polygon, a button I created in the pop up of the feature layer that contains the URL link to the Survey123 survey pops up. After clicking the button, the Survey123 form pops up, the user can fill in the fields, but no fields are passed. Submitting the survey creates a new record in the attribute table of my feature layer but doesn't pass any existing fields nor edit the existing feature layer. It seems the survey is not connecting to the existing feature layer but the data is being placed in records of the feature layer attribute table as a new record...even though mode=edit is included in the URL.
Hello - I wanted to thank you for taking the time to help. I ended up getting a ticket with ESRI and they solved the issue. This is the following URL that does the job: href="arcgis-survey123://?itemID=47a103b3abc04c05be8a1088b8a5a7f4&folder=inbox&update=true&action=edit&q:GlobalID={GlobalID}&field:PlantingAreaType={PlantingAreaType}&callback=https%3A%2F%2Ffieldmaps.arcgis.app"
I am not sure why these are in there &
But I think your issues as stated before is you cannot edit globalid, or the shape fields so those make no sense to be in there. It is prob refusing your URL because globalids MUST be generated by the database you can never force them to anything. Same with Shape.
If I was you I would create a new key field that is a text string that makes sense. I do PlotID+Date that I generate in Arcade in Field Maps (since we may visit more than once). Note you can pass to parentglobalid as you said since that is text but that is not what your URL is doing. GlobalIDs are a poor choice for relates since if you ever move the data it all falls apart (or restore from backup, etc). Then pass this generated key to 123 into a text field. Build a relate that uses this new key. You really only need to pass the key since the parent has the data and geo already. No need to dup data (it becomes a total pain to make changes). 123 can just be a point that is where the user started the form. This is great for QA since you will find users in the wrong spot all the time.
I do this all the time. I have a full writeup here.
Hope that helps, I am pretty what you are trying will not work.
Other idea is give 123 a offline basemap then just make the polygons and all that in 123 only and skip Field Maps.
Hi - Thank you for your reply. I will try your recommendation. I just wanted to mention that I had inserted & into the code and the app keeps changing all of my &s to $amp;
I have no idea why.
Hello - I wanted to thank you for taking the time to help. I ended up getting a ticket with ESRI and they solved the issue. This following URL works: href="arcgis-survey123://?itemID=47a103b3abc04c05be8a1088b8a5a7f4&folder=inbox&update=true&action=edit&q:GlobalID={GlobalID}&field:PlantingAreaType={PlantingAreaType}&callback=https%3A%2F%2Ffieldmaps.arcgis.app"
Hi again - You recommended building a relate that uses this new key. If I am understanding correctly, wouldn't this relate need to be created in ArcGIS Pro, or no? If this is correct, wouldn't that require me to republish my feature service? If I republish the ID of the feature service for my web map used for Field Maps would change and the formatting of my web map (forms, popus, etc.) would need to be redone ? Wanting to pass this value from Field Maps to Survey123 is something that has been decided now that my map is completed. Hopefully, I am wrong on this.
Yes you would need to republish. But then you said it is an existing service. What is the relate on there now? Does it use globalids? Can you add another one?
Even if existing you still can never edit a globalid. You just need 2 keys that match in each layer and a relationship class that links those keys. There are many ways to do that. Hard to tell in your system.
My Survey123 forms I am using in Field Maps were created from an existing feature service. I don't know if that is causing an issue?