AnsweredAssumed Answered

How do I make my Survey123 survey a Related Table to a Feature Class?

Question asked by frohr.CALFIRE on Mar 14, 2019
Latest reply on Sep 9, 2019 by JTedrick-esristaff

 

 

I have created a tree inspection survey in Survey123 Connect and want the data to go into a related table to a tree point feature class in AGOL. I am using Collector to view the tree points and have configured the pop-up to include the survey link and populate two of the survey fields with data from the tree points. However, when I collect the data it is stored in the survey feature class rather than the related table. I can't figure out where I've gone wrong.

 

Here’s my workflow:

 

  1.  Create survey in Survey123 Connect (I have a hidden GUID field with esrifieldtype:GUID - I'm not sure how the GUID is entered)
  2.   Publish survey to AGOL
  3. Export published survey from AGOL to file geodatabase and download to my computer
  4. Export the tree point feature class from a different geodatabase into the downloaded survey geodatabase
  5. Add a Global ID to the tree point feature class
  6. Create a geodatabase relationship (Tool: Create Relationship Class) of 1:M with the tree points being the original table and the survey being the destination table. Origin primary key: GLOBAL ID from tree point feature class and origin foreign key: GUID from survey point feature class.
  7. Add both features to an mxd with the survey point first in the Table of Contents
  8. Publish to AGOL as a new feature service – double check that the survey layer has FeatureServer/0 in its web address. I notice that the GUID field does not show up in the attribute table after publishing - something's wrong here. Enable editing/sync
  9. In Survey123 Connect, delete .iteminfo file from the project folder
  10. In AGOL delete the original associated Survey123 folder
  11. Republish the Survey123 project
  12. Create a web map with the newly published feature service (tree points and survey layer)
  13. Configure pop-up to include link to survey (this works) and populate two survey questions with data from the tree point (this also works)

 

BUT, the data I collect goes into the republished survey123 project and not the related table to the tree points. There's obviously something wrong with my GUID, or lack of one, and I wonder if I need a submission url in my survey?

 

I have managed to attain success after much trial and error - here's my adjust workflow:

  1. Create survey in Survey123 Connect (Must have a GUID field with esrifieldtype:GUID – mine is a hidden field)
  2. Publish survey to AGOL
  3. Export published survey from AGOL to file geodatabase and download to computer
  4. Export the tree point feature class from a different geodatabase into the downloaded survey geodatabase
  5. Add a Global ID to the tree point feature class (Data Management Tools, Fields, Add Global IDs)
  6. Create a geodatabase relationship (Data Management Tools, Relationship Classes, Create Relationship Class) of 1:M with the tree points being the original table and the survey being the destination table. Origin primary key: GLOBAL ID from tree point feature class and origin foreign key: GUID from survey point feature class.
  7. Add both features to an mxd or ArcPro project with the survey point first in the Table of Contents
  8. Publish to AGOL as a new feature service – double check that the published survey layer has FeatureServer/0 in its web address. Enable editing/sync for use in Collector.
  9. In Survey123 Connect, on the xls form Settings tab, add in the submission url – https://www.arcgis.com/sharing/rest/content/items/itemID - note, I used the item id of the target layer in my feature service (the survey layer). I found this item ID by following the JSON link on the ArcGIS REST Services Directory of the target layer (click on target layer name of the feature service). The form id only needs to be filled in if the target layer has a different name from the xls form file name. In my case it doesn’t.
  10. In Survey123 Connect, in the project folder, delete the .iteminfo file (I don’t know exactly what this does but it appears to be necessary)
  11. In AGOL delete the original associated Survey123 folder
  12. Republish the Survey123 project
  13. In survey123.arcgis.com click on the newly republished survey, then go to the Collaborate tab, and make sure that ‘Open the survey in the Survey123 field app directly’ is selected.
  14. Create a web map with the newly published feature service (tree points and survey layer)
  15. Configure pop-up of tree point feature to include link to survey and populate two survey questions with data from the tree points. NOTE: the item id used in the link to the survey is not the same as the item id that is in the submission url. This item id is the one that is for the republished survey form. You can find that item id in the web address of the survey through survey123.arcgis.com
  16. Make sure to download the newly published survey to Survey123 app before using Collector or Explorer.

 

I hope this helps anyone else struggling with this task.

Francesca

Outcomes