Pass Global ID from Collector to G

11229
33
01-25-2018 07:24 AM
KevinKozak
Occasional Contributor

Has anyone been able to pass the Global ID from a service in Collector to the related GUID in Survey123 using the URL method?

I have a database relationship of Bridges to Inspections. In addition, Inspections have related Elements. Since Survey123 can only go two deep in relationships I have a service for Bridges in Collector and the Inspections and Elements in Survey123. I have created the Survey123 from the Inspection and Element service.

33 Replies
JamesTedrick
Esri Esteemed Contributor

Hi Evan,

It is not currently possible to send data into multiple repeats.  Instead, you may want to have a separate form for cross arm entry that gets opened for each cross arm.

0 Kudos
EvanOlivier
New Contributor III

Hi James,

Thanks for your response. Would this require the Cross Arm form to be a feature class of it's own instead of a related table? Or could I cut out the rest of the feature service from that form and publish a component only survey that shares the submission url of the larger feature service?

Best,

Evan

0 Kudos
KevinKozak
Occasional Contributor

Hello James,

I was able to implement your suggestions and it worked. Old dogs can learn new tricks. Below is the general outline I used in case someone needs to do the same type of function.

  • Create database in a file geodatabase with relationship class of Global ID to GUID.
  • Create ArcMap document with data layers and save as service in AGOL.
  • Set service to allow editing and share to editing group.
  • In Survey123 Connect, create new survey by importing service.
  • In XLS Form add a text question that has a Null field type for holding the related Global ID.
  • In XLS Form add a text question that has a GUID field type. For the question name, use the same name as the GUID in the service.
  • For the GUID question use the following calculation to remove the curly brackets from the Global ID. if(regex(${brdg_guid_txt}, '^\{[\w\-]*\}$'), substr(${brdg_guid_txt},1, string-length(${brdg_guid_txt}) - 1), ${brdg_guid_txt})
  • In AGOL create a web map with the related service to the one in Survey123. Use the following popup line.  arcgis-survey123://?itemID=affe05ec8db8448daccb0688c9583ce8&field:brdg_guid_txt={GlobalID}

Thank you for your help. If you are every in Olympia, WA please let me know. I owe you a cup of coffee.

Kevin

0 Kudos
EvanOlivier
New Contributor III

Hello Kevin,

Does this method prevent survey123 from creating it's own feature in the feature service, instead allowing the related table information to pass back into the existing feature you opened from collector? If so, this would be very useful for me as well. I am trying to build a workflow where inventory is collected in collector, while inspections of the asset are done in survey123. At the moment, uploading will create a point from collector inventory and another pole point from survey123, with the first containing only inventory information and the later containing no inventory information and only related table inspection information, requiring us to join the two points into one feature later. Definitely not ideal. Please let me know, thank you.

0 Kudos
KevinKozak
Occasional Contributor

Hello Evan,

I just completed creating a culvert inspection application where culverts have related inspections. The culverts is in one service and the inspections in a different feature service since Survey123 always creates its own point. Hopefully, at some point Survey123 will work with tables too. I pass the GlobalID from culverts to the inspections through a URL link. In the Survey123 connect form you do have to add the foreign key question as hidden and type of GUID. That is the question field you pass the related GlobalID too. No more needing to add a text question in Survey123.

Hope this helps,

Kevin

by Anonymous User
Not applicable

Hi Kevin,

Did you need to create a relationship between the culvert and inspections beforehand? Have you tried passing the GLOBALID from one service to the GUID of another service (but they're not related)? I am doing it this way and I can see from my url bar that it's getting passed but it's not showing up in the survey.

0 Kudos
KevinKozak
Occasional Contributor

Hello Gil,

I have created the relationship class before passing. I still think you have to pass the global ID even if there is a relationship since they are two different programs. But I am not sure of that. Make sure you have added the GUID field in the survey form. I did this using Survey123 connect.

0 Kudos
SuddhaGraves
New Contributor III

Hi James,

I have a follow up question associated with this topic.  I was able to successfully pass the GlobalID from Collector to Survey123 using the custom url.  It works as expected when creating a new record.  However, if I try to edit an existing record using the inbox in Survey123, I get a Code 400 send error.  After much trial and error, I noticed the GUID field had the curly brackets added back into the value.  If I went in and removed the curly brackets during the edit and resubmitted it would successfully update.  Otherwise, I get a Code 400 send error.  Any thoughts?

Suddha

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Suddha,

See my comments in https://community.esri.com/message/761251-re-survey123-converting-characters-to-code?commentID=76125...  - for working with curly braces in globalids.

0 Kudos
SuddhaGraves
New Contributor III

Hi James,

Thanks for the responding.  I have read through the comment you suggested and I verified that I was following the instructions as noted in the comment.  The process appears to work when submitting the initial record.  However, the problem arises when I have to edit an existing record from the inbox.  When editing an existing record, the curly braces are put back on the GUID field.  Unless I manually remove the braces, I will receive an error when submitting.  I am hoping there is another way to automatically remove the curly braces when editing an existing record.

Thanks,

Suddha

0 Kudos