I'm trying to do something in Survey123 (Enterprise/Portal) that I don't know if possible.
Context: I have a form built that the public can fill out. On the backend (via Integromat), upon submittal a PDF report of the survey gets emailed to the submitting user and CC'd to an internal email address.
Question: The survey has a geopoint field. Can I take this data and use another feature service to essentially do a spatial join/point-in-polygon and calculate a new field in the survey with attribute information based on the external feature class? Basically - I want the form to autopopulate a District field based on the geopoint location. The District boundaries are in a separate feature class in my Portal. I intend to then filter the survey results in Integromat and only email each district's surveys to each district's POC.
For your second question I don't think a Webhook would be best because they are more geared towards individual responses. What you can do is use the Survey123 module in the ArcGIS API for Python and specify the `where` parameter to return only records that match a certain District. Ismael wrote a good blog on using Python to configure an email notification system. The email piece of that script can be used to automatically send the email to the Districts email address. Or if you did want to use Webhooks you can use this workflow to use the Python API script in a Webhook.
We are in the process of creating documentation to help understand the Survey123 module in the Python API, but I have attached a sample notebook that highlights how to work with Reports using Python.
Hi Zach -
Thanks! So, I got the first part working in Survey123 Connect. I'm having the survey pull data from our districts layer and populate a District ID field based on the geopoint. It works fine when I test it in Connect, but when I publish it and access it via a web form, the District ID does not populate in my survey. Any thoughts? I'm using the new beta geocode appearance for the geopoint, if that matters.
As for the email... I think I found a way to do what I need in Integromat, but I'll need this District ID field to work before I can test it completely.
@ZacharySutherby update to my last post: I think it maybe does have something to do with the beta geocode appearance I'm using? For the geocode, I have the user enter an address (NOT on a map, but just by typing, according to instructions provided to me by @IsmaelChivite on this post: https://community.esri.com/t5/arcgis-survey123-questions/set-default-geosearch-parameters/m-p/102296... ). In the web form, a matching address populates another field that corresponds to the selected address. This functionality is known to not work in Connect or the App, but it works perfectly in the web form.
It seems I'm having the opposite problem with this District ID field. The District populates correctly in Connect and the App, but not in the web form (where I really need it!). Any ideas of how to fix it so it works in the web form?
EDIT: my survey is public - I guess that’s why it isn’t working? Is there any workaround for this? The functionality is exactly what I’m looking for!