Select to view content in your preferred language

Auto populate in Survey123 from existing feature attributes

26012
21
05-01-2018 11:47 AM
ShelbyPW1
Emerging Contributor

I am trying to use ArcGIS Online and Survey123 to create an inspection form that works against an existing feature. For example; I have a bunch of construction site points that I need to conduct various inspection on. I am having trouble getting some of the fields to auto populate in survey123 from the existing feature (Project Name, Project Type, Permittee, etc). If someone could point me in the right direction I would be very appreciative. I have attached a copy of my spreadsheet. Thanks.

21 Replies
RaviKamarajugadda1
New Contributor

Hi Brett,

Do you have any kind of Excel or CSV file which shows relationship between Construction Site vs Project Name, Project Type and Permitee Etc.. so that you can upload CSV to Survey123 and use Pulldata() function.  You can change appearance for the fields you want to AUTOCOMPLETE

0 Kudos
ShelbyPW1
Emerging Contributor

I think I figured it out. I was unsure where to copy the custom url that allowed me auto populate. I ended up attaching the custom url to a feature service pop up. Not sure if that is the best method but it worked for me. Thanks.


Brett

0 Kudos
NatashaDakouri-Hild
Occasional Contributor

Hi all. I am having a similar issue. I created a survey using an existing feature service in AGOL through Survey123 Connect. The feature service has polygons (agricultural tracts) and fields that describe various attributes. That process went fine and the survey looks great. Using these instructions (Uhttps://community.esri.com/groups/survey123/blog/2016/07/30/understanding-survey123s-custom-url-sche... I added a custom attribute display url to the layer in AGOL to call up the survey form in Collector. Because I want the survey form to have the area and tract ID prepopulated I added the relevant fields too:

arcgis-survey123://?itemID=69c04a817b534bddb2eeef3d0f7c2832&field:Tract area={Area__m2_}&field:Tract ID={Code}

Basically I'd like to see this behavior: user goes to Collector, clicks on a polygon in the tract layer, and the link to the survey opens up with the name of that specific tract showing in the tract ID field of the survey and its area prepopulated. What am I doing wrong? While the survey is correctly linked in the Collector app when I edit the layer, the fields do not prepopulate. I did a test data entry and the survey simply creates a new entry.

I have enabled inbox btw.

Thanks!

UPDATE: okay, figured it out. So for those poor bastards who are doing this from scratch (like me), if you have an existing AGOL layer you want to connect to a new survey, here are the steps:

1. Make sure the layer is properly shared with the same group as the survey. Make sure your fields are finalized before the next step. Make sure the layer has sync and full edit abilities selected (and attachments enabled if you plan to have an attachment field in the survey). (If you enable the attachments first then do allow the edit/sync you may have to disable the attachments and enable again for some reason).

2. Create the survey (best to do this in Survey123 Connect). Make sure the survey uses exactly the same names and types of ESRI data as the layer on AGOL (check the schema in Survey123 Connect to be sure).

3. Publish the survey to the existing feature layer. This can be updated after you publish it from Survey123 Connect (make the needed changes and republish to the same layer).

4. Next, go to AGOL and open the map that contains the feature layer. From Content, highlight the layer in question and select Configure popups.

5. Select Custom Attribute Display. Click on the green Configure button and select the link icon.

6. Go to survey123.arcgis.com and select the by now published survey. Select Collaborate in the green ribbon, then from Link below select Open the survey directly in the app. Click that link next to the sentence (Learn more about this option) and copy survey link e.g. arcgis-survey123://?itemID=69c04a817b534bddb2eeef3d0f7c2832 

7. Go back to AGOL and the Custom Attribute Display interface. In the URL field add the link above.

8. If you want some fields prepopulated from the AGOL layer, add the relevant fields with ampersands right after the survey link. E.g. arcgis-survey123://?itemID=69c04a817b534bddb2eeef3d0f7c2832&field:Tracts={Tracts}&field:Area={Area}&field:Code={Code}

Note that in the formula above the field names without brackets must correspond exactly (including any capitalization) with the survey field names where the information is to be autofilled and the field names with brackets must correspond exactly with the fields of the AGOL layer from where the autocomplete data is to be pulled.

I still can't stand how complicated all of this needs to be. ESRI, come on! This is key functionality, it shouldn't be this obscure to figure out. How about some better documentation? How about a push option to connect to an AGOL layer straight from the Survey123 app?  Been a long, long day.

DougBrowning
MVP Esteemed Contributor

You can built a form right from a feature service.

0 Kudos
NatashaDakouri-Hild
Occasional Contributor

Of course, I have uploaded the survey to an existing service. But that's not my problem -the issue was how to pass data already in some fields into the survey form to avoid redundant typing, and how to integrate the survey with Collector which shows you the specific polygons that are being added with attribute data. Very clumsy solution, but it works. ESRI needs to streamline this.

NatashaDakouri-Hild
Occasional Contributor

Also, once in the survey there seems to be no easy way of going back to Collector unless one hits the back button repeatedly. But I have now also built a call back code in the popup to speed that up a bit. Still not ideal if you're dealing with hundreds of polygon edits/survey adds in a day.

YuyingLi
Emerging Contributor

Hello - thanks for sharing. I had the very similar situation but it seems to always create a new record instead of editing the existing record? Or do I miss anything? 

thanks,

Yuying

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Yuying,

Currently, the field app only supports creating a new feature when opened via a URL, not editing an existing feature.

0 Kudos
YuyingLi
Emerging Contributor

James,

Thank you for confirming it. I have a separate question – I thought with the latest 2.4, related table could be edited?

In Survey123, it seems I still couldn’t edit the related data? If still the case, how should I edit the record? In Survey123 app?

Yuying Li, GISP

D 858.712.8381 M 858.380.8024

hdrinc.com/follow-us<http://hdrinc.com/follow-us>

0 Kudos
JessicaJThompson
Frequent Contributor

Hello James,

I believe I am trying to do something similar to @NatashaDakouri-Hild's work in 2019. It now being 2021, is there a way to do this just in Survey123 (Using Survey123 Connect 3.11.123 and hoping to put into Experience Builder or WebApp Builder for the survey team, though may just default to Survey123 App).

I posted a question today at the following (Re: Select Parcel (Polygon) in Linked Map & Pull D... - Esri Community), and was referred to this discussion. 

Thanks for the assist!