Select to view content in your preferred language

Auto-populting Survey123 Related Table field with a Field from the Parent Layer

782
3
Jump to solution
02-06-2024 01:16 PM
CailaHolbrook
Emerging Contributor

I have a feature service on AGOL with a related table used for asset inspections. The parent layer has a GlobalID field that is related to the table through a GUID field. For each new observation (record) in the related table, I want to grab a Site_ID field from the parent layer to fill the Site_Number field in the related table. This was pretty straightforward to do using the field Maps Designer and calculated expressions (I used this tutorial: https://www.youtube.com/watch?v=TbDY0IpaDoI).

However I have also configured pop-ups for the features that link to a survey I created in Survey123 Connect. Everything works fine in here, with the GUID field being automatically filled in the related table using the GlobalID in the parent layer. the issue is that the Site_Number field isn't being filled. My understanding is the field maps designer expression I wrote does NOT work for records entered into the related table via the Survey. Is there an expression I can write in the Survey123 Connect xls that will pull the Site_ID from the parent feature and populate it in the Site_Number feature of the related record?

 

Thank you

0 Kudos
1 Solution

Accepted Solutions
DougBrowning
MVP Esteemed Contributor

If you already have the URL working just add more fields to it and you are done.

arcgis-survey123://?itemID=1851f5ff07d340c0a3&field:PointID={PointID}&field:Project={Project}

View solution in original post

3 Replies
DougBrowning
MVP Esteemed Contributor

You can use pulldata with @layer to get it if you are online at the time. 

Or you can use a URL to launch the form and pass the data to the form from the parent in Field Maps.  That is how I do it.  Works slick.  I think what you are saying is you are using the blue plus sign in Field Maps?  If you do that only the relationship key gets copied for you.  You really want to launch the form from the parent though.

Like this

arcgis-survey123://?itemID=1851f5ff07d340c0a3e311e362db6e63&field:PointID={PointID}

Hope that made some sense not sure I am following you.

0 Kudos
CailaHolbrook
Emerging Contributor

Hey there thanks for your reply! Sorry I think i'm not being clear. We're launching a citizen science program where members of our community can fill out surveys to answer different questions regarding tidal zones at pre-determined sites. The idea is to share a web-app, where volunteers can click on one of those sites and fill out the survey. I've used the URL method you mentioned above so volunteers can click a site, a pop-up appears with a link to the survey. When they fill out the survey, the GlobalID is passed from the clicked feature to the related table (Ie the PointID={PointID} portion of the link you shared). This is all fine, except there is another field I want passed from the parent field to the related table (in addition to the GUID). Like I said I was able to do this in the Field Map Designer, which works when data is entered using the related table in Field Maps, but NOT when volunteers click the link to fill out the data in Survey123 using the web-app.

I think the pulldata in Survey123 Connect is what i'm looking for. Can you maybe provide a little more information on how this works? Presumably I would use @pulldata in the "Calculation" field for "Site_Number" field of the related table. I followed this tutorial to set up Survey123:https://support.esri.com/en-us/knowledge-base/how-to-populate-a-related-table-from-an-arcgis-survey1....Following this i've deleted the "begin repeat" and "end repeat" fields as well as all fields relating to the parent table. I'm unclear about how pulldata can be used to grab the "Site_ID" from the parent table when the xls has no information on the parent table's fields.

 

Thanks!

0 Kudos
DougBrowning
MVP Esteemed Contributor

If you already have the URL working just add more fields to it and you are done.

arcgis-survey123://?itemID=1851f5ff07d340c0a3&field:PointID={PointID}&field:Project={Project}