How to pass the Parent GlobalID to my related table using only Survey123?

04-27-2018 01:38 PM
New Contributor III


I have Vehicle Equipment data related to Maintenance Logs. Although Vehicle equipment does not necessarily have a geographic component, I have created points for each of the vehicles in order to use Survey123.  The maintenance log is a table related to the vehicle point. The vehicle points will not be edited nor will new points be added, I just want to create new maintenance logs using Survey123.  

I have gone through all the steps to set up my existing feature service for use in Survey123; I use GlobalID (from the Vehicle Point) as Primary Key and I have a MaintID (Guid field from Maintenance Log) as the Foreign Key, I have the Maintenance Log set in the form_id, and I have no errors when I publish my survey.

My survey is all set up to create new maintenance logs, except I would like to auto-populate my MaintID field using the GlobalID from my Vehicle Points so field staff will not have to, and I want this all done using Survey123.  I do have field staff select the Equipment Name (its a domain) with each new maintenance log.  This is a unique field and each equipment name has an associated GlobalID from the Vehicle Point. 

If field staff enter in the Equipment Name, is there an XLSForm expression that could pull the GlobalID that is associated with that Equipment Name, and then populate the MaintID field with that GlobalID?  I am new to XLSForms. Or is there another way?  I have attached an excel table that lists all the equipment names with associated GlobalID to maybe better explain and I have attached my XLSForm from my survey. 



0 Kudos
1 Reply
Esri Regular Contributor

Hi Alison

You are nearly there: please see the attached files.

Essentially I have added a new field to the survey and given it the esriFieldType of GUID.

Then I used pulldata to populate this question with a globalid based on the equipment type that was selected.

Things you will need to modify:

1) Update the parentglobalid question name in the survey with the correct field name for the parentglobalid field in your table. This should be the child GUID field used in the relationship between featureclass and related table.

2) Remove the curly brackets from the .csv used by the pulldata function (attached) - these are not required.

3) Re-add the form id and submission urls in the form (I removed them so I could publish the form).

Let me know if you need any help