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.
Hi Kevin,
What you're asking for is possible. You would need to configure the Bridges layer's pop-up to have a url that includes the GlobalID in the parameters; this is described in Integrate with other apps—Survey123 for ArcGIS | ArcGIS and https://community.esri.com/groups/survey123/blog/2016/07/30/understanding-survey123s-custom-url-sche... . This would go into a hidden field.
There is a known issue with Survey123 receiving the globalid value - it can't process the value if it already has curly braces ( { } ). To get around that, the survey should be designed with 2 fields to handle the globalid value:
if(regex(${incoming}, '^\{[\w\-]*\}$'), substr(${incoming},1, string-length(${incoming}) - 1), ${incoming})
The regex detects if the guid is formatted as {1080901b-c30d-411b-a485-151c8f6ad8e6}, if the braces are present, it extracts the portion between the braces, otherwise it passes the guid unaltered. The field type should by of esriFieldTypeGUID.
See the attached sheet for an example of this pattern.
Hello James,
I appreciate your response. I read the articles you provided, they were informative. Being an old GIS dog trying to learn new tricks, I still have some questions.
Below is my thought process based upon your suggestions.
Thank you for your help,
Kevin
Hi Kevin,
The URL as you've specified looks to be appropriate for what you're describing.
Can the incoming and parentglobalid fields be hidden? When I set the type to hidden, it doesn't populate the parent GUID.
Hi Christopher,
Yes the fields can be hidden. I will note that the workaround of having 2 different fields to normalize is no longer needed. Make sure the hidden parentglobalid question has an esrifieldtype of esriFieldTypeGUID.
So remove the regex as well?
Update: I was able to get this working with a hidden parentglobalid field - thanks James!
Hi James,
Thank you for all your advice throughout these forums. I am trying to create polygon, line or point features that collects a location and information in collector, than using the custom URL scheme pass the GlobalID and some information to a more detailed survey with repeats.
I wanted this Survey to publish data to the same feature service (different feature class and table) of the original feature so it can be related to the survey results in AGOL. I was able to make this work creating relationship files and publishing the Survey123. I was able to create the custom url and pass the global ID through to survey123 using the "if(regex(${incoming}, '^\{[\w\-]*\}$'), substr(${incoming},1, string-length(${incoming}) - 1), ${incoming})" formula.
My tests have shown that it works though the windows web interface and on IOS, but it will not pass the GlobalID though using Android. I am on Android 9 using the "Collector for ArcGIS" and Collector (BETA), as well as using Survey123 (4.1) as well as Survey123 (Classic). Any advice? Thanks! Joe
I know this is an old question but I am trying to do this same operation and having no luck. If I understand correctly, Survey123 should now be able to hand correctly a GUID passed in a URL without first stripping the curly brackets? I must be having a different issue because I can't get Survey123 to process the GUID properly either way.
I have map set up with Field Maps. In that I collect some overall data for a group of samples. Once that data is collected I have a URL set up in the popup to open a survey and pass three field values to it. The first two a just text values and they work fine. The third is the GlobalID that I am passing to a parentglobalid field in the survey. The parentglobalid field always ends up blank in the survey. This is while using the Field Maps and Survey123 apps on an iPhone. Here is the odd thing, for testing I also set up the popup to have a separate URL to open the Survey123 web app. This one does pass the GlobalID. Below are the 2 generated URLs.
Phone app:
"<a href="arcgis-survey123://?itemID=afc70f91e8c648a7a2e87ed6f310eb8c&field:Control1=2400003&field:Gear1=935&field:parentglobalid=fafdf05b-554c-4d4c-b513-bc859dc871f1">Link to App Survey</a>"
Web App
"<a href="https://survey123.arcgis.com/share/afc70f91e8c648a7a2e87ed6f310eb8c?&field:Control1=2400003&field:Ge...">Link to Web Survey</a>"