I am developing a survey that is to be used to update existing points with water quality data via a related table. All of which is currently hosted in AGOL. I've created a relationship class using Global ID for the site points and a Parent GUID field in the related table. All of that seems to be working as intended, but when I try and submit a test survey an error pops up that says: "Send Error: Object reference not set to an instance of an object."
I have the submission URL set to the Feature Class address that is located on feature service overview tab and the Form ID field set to the related table name.
Any information that is available would be greatly appreciated! Note: the lack of documentation that exists about updating point features is pretty shocking. I would expect this to be a very common use case as many workflows would require the use of updating existing locations with new data....
Solved! Go to Solution.
Hello @MFazio,
To add water quality samples (related records) to existing sample sites (parent records) you'll need to add the parent GUID field/question to the XLSForm and then populate it with an existing global ID from a record in the sample site table to associate the new water quality sample record with the sample site. Check out step 7 from this Esri Support article for reference.
From there you'll need to use the field:<fieldname> URL parameter to populate the parent GUID question in the survey passing it from the sample sites table.
Hello @MFazio,
Would you be able to provide a screen capture of the submission_url set in the XLSForm? When you say you set the submission_url to the "Feature Class address that is located on the feature service overview tab" it sounds like you set it to the URL for the Item Details page (https://<org>.maps.arcgis.com/home/item.html?id=<itemID>) which would be the incorrect URL, the submission_url should be the content root endpoint (https://www.arcgis.com/sharing/rest/content/items/<itemID>).
Since you have the Form ID set to the related table name, to confirm you don't have a begin repeat or end repeat in your XLSForm?
Please see these documentation links for more information on using Survey123 with existing feature services:
https://doc.arcgis.com/en/survey123/desktop/create-surveys/survey123withexistingfeatureservices.htm
Zach,
Thank you for your reply, I have tried multiple different addresses, including the default that is provided when creating the form. I have removed the repeats, and really dumbed down the data to just try and get a proof of concept working. Here are a couple of screenshots showing my current settings:
Hello @MFazio,
To add water quality samples (related records) to existing sample sites (parent records) you'll need to add the parent GUID field/question to the XLSForm and then populate it with an existing global ID from a record in the sample site table to associate the new water quality sample record with the sample site. Check out step 7 from this Esri Support article for reference.
From there you'll need to use the field:<fieldname> URL parameter to populate the parent GUID question in the survey passing it from the sample sites table.
Hi Zach,
Thank you for all of your help. To be clear, the only way to accomplish my desired functionality is to use pop-ups on a web map? I was hoping to just have a text based survey that would populate the related table, using the web map only to display the data to the public.
Thanks again,
M
Hello @MFazio,
You don't necessarily have to use a web map to provide the URL with the global ID the KB article uses a web map because that's a common workflow. Ultimately the global ID for the parent record would need to be populated in the related record to correctly associate it.
An alternative workflow would be to have your survey point to the Sample Sites layer and leave the repeat in the form, but make all the questions from the Sample Sites layer readonly that way you can use the Inbox or mode=edit web app URL parameter to add new repeats (related records). Do note that the mode=edit web app URL parameter would also require a globalID to be passed along so that the web app knows what record it should be editing.
Thank you for your help, Zach - I marked the previous response as a solution as it did get me a working prototype. For that I am very thankful!
However, I am still interested in a non-web map based workflow, and would be grateful if you could elaborate a bit more on this. I guess my hang-up is how would I choose which point to relate the record to from a survey only approach? Would I need to include the global ID as a question so that it knows which to relate to?
Further, Is there a reason why I have not found many workflows that show this approach?
UPDATE: I believe I have worked out the survey only approach. I believe it is the case that the Site data must stay outside of the repeat section. Then I disabled the "Sent Folder" and Enable the "Inbox". After publishing this, I can then select my sites from the Inbox after refreshing. Certainly doesn't seem to be the most intuitive process, but it is working as intended!
Thanks again!
- Mike