Collector to Survey 123 link will not pass GlobalID to GUID but will accept raw text value

1165
2
Jump to solution
06-17-2021 11:54 AM
DavidRichey
Occasional Contributor

I have a relational (5-level) ArcGIS online feature service that I would like to use Survey123 to populate some of the related tables used for inspection events. I cannot get the GlobalID to properly pass to the child GUID field in the survey to relate the created record to its parent.

  1. I created the Feature Service by uploading a Survey123.xlsx through ArcGIS connect.
  2. I then downloaded the created database and altered the relationship to the inspection tables to Use a GUID field on the tables to be populated by the parent feature GlobalID, and deleted the parentgloablid field in the inspection table.
  3. I deleted the survey and its components, including the database, and uploaded the modified geodatabase (I've tried both publishing from Pro and uploading the zipped gdb).
  4. I created a "master" survey by linking to the feature service through Connect, and published that as not-offline-enabled to create a database dashboard. I used a subset of the master survey to create the inspection record survey with no repeats and the GUID field added in (tried as both GUID and Null in the bind::esri:fieldType). this successfully linked to the feature service through connect.
  5. I created a Collector Classic map and populated the popup for the feature with the url for the survey. I can get other fields to populate properly and display in the master survey dashboard, but not the GUID and hence no relation to a selected parent record.
  6. I think I have all my other settings configured correctly, such as "supportsApplyEditsWithGlobalIds" : true"

Frustratingly, I can properly pass the GlobalID to GUID value if I code it as raw text in the constructed url (from copying the GlobalID from the messages console and using it in the pop up). This is befuddling, as the TypeOf function returns string for both the GUID and the Text(GUIID) variables. As well, the GlobalID will not pass to a text field, but encoding the pasted text value will. Could there be a problem with having two surveys pointing at the same feature service? I would not think so, but is could be.

I may have to go with loading a separate survey and passing the centroid of the feature to the survey. I'd rather have all the users view all the data through one survey dashboard. It is frustrating to be so close. Here is the Arcade from the popup (testing apparent) and the return.

Any thoughts @JamesTedrick , @IsmaelChivite ?

var url_scheme = "arcgis-survey123://?itemID=6d69688d4473456a81f46ae892408422";
var this_unit_GlobalID = $feature.globalid;
var this_unit_GlobalID_txt = Text($feature.globalid);
console (this_unit_GlobalID);
console (TypeOf(this_unit_GlobalID));
console (this_unit_GlobalID);
console (TypeOf(this_unit_GlobalID_txt));
var site_Name = "TestSiteName";
var unit_ID = "TestUnit";
var theDate = Timestamp()
var Planting_Unit_ME_ID = site_Name + "-" + unit_ID + "-" + theDate
var url = url_scheme + "&field:GUID_PlantingUnit_ME=" + $feature.globalid; //this_unit_GlobalID, this_unit_GlobalID_txt did not work either; "4bb95e5e-6a90-470f-804e-3507e24eccef" does work!
var url = url + "&field:Planting_Unit_ME_ID=" + Planting_Unit_ME_ID;
var url = url + "&field:Monitoring_Event_Note_PUME=" + "4bb95e5e-6a90-470f-804e-3507e24eccef"; 

Console(url);
return url;

arcgis-survey123://?itemID=6d69688d4473456a81f46ae892408422&field:GUID_PlantingUnit_ME=f65ec795-1ae5-47b7-bf05-a9c056306a8b&field:Planting_Unit_ME_ID=TestSiteName-TestUnit-2021-06-17T18:37:01-07:00&field:Monitoring_Event_Note_PUME=4bb95e5e-6a90-470f-804e-3507e24eccef

Use Console Function to output messages.

f65ec795-1ae5-47b7-bf05-a9c056306a8b
String
f65ec795-1ae5-47b7-bf05-a9c056306a8b
String
arcgis-survey123://?itemID=6d69688d4473456a81f46ae892408422&field:GUID_PlantingUnit_ME=f65ec795-1ae5-47b7-bf05-a9c056306a8b&field:Planting_Unit_ME_ID=TestSiteName-TestUnit-2021-06-17T18:37:01-07:00&field:Monitoring_Event_Note_PUME=4bb95e5e-6a90-470f-804e-3507e24eccef

0 Kudos
1 Solution

Accepted Solutions
JamesTedrick
Esri Esteemed Contributor

Hi @DavidRichey ,

This may be better asked in https://community.esri.com/t5/arcgis-collector/ct-p/arcgis-collector

Can you confirm that you are using Collector Classic (i.e., version 19.0.2) as opposed to Collector (current version 21.0.1)? Collector classic doesn't support Arcade at all.  There is also an issue with the Arcade interpreter used in ArcGIS Runtime that prevented the display of GlobalId; it appears that Collector is using a version of Runtime that is affected by that.  You should see the value appear properly in Field Maps.

View solution in original post

0 Kudos
2 Replies
JamesTedrick
Esri Esteemed Contributor

Hi @DavidRichey ,

This may be better asked in https://community.esri.com/t5/arcgis-collector/ct-p/arcgis-collector

Can you confirm that you are using Collector Classic (i.e., version 19.0.2) as opposed to Collector (current version 21.0.1)? Collector classic doesn't support Arcade at all.  There is also an issue with the Arcade interpreter used in ArcGIS Runtime that prevented the display of GlobalId; it appears that Collector is using a version of Runtime that is affected by that.  You should see the value appear properly in Field Maps.

0 Kudos
DavidRichey
Occasional Contributor

Moving to Field Maps resolved this issue. The Arcade will work in Collector to pass values to the recieveing survey, with the exception of the parentglobalid. This can be gotten around by calculating the value in the Survey form, and adding a null incoming parentglobalid with a regex calculation providing the value as described here by @JamesTedrick.

In Field Maps, I would recommend using the Classic map Viewer, as is done currently with the Mobile worker and Dispatcher Maps with Workforce. Would this be your recommendation, @JamesTedrick ? 

0 Kudos