Pass Global ID from Collector to G

11471
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
StephenEJohnson
New Contributor

In case anyone else runs into the same problem, I figured out that you have to use the arcade function URLencode on the GlobalID so the Arcade code for URL in my original question would become:

'<a href="'+AppURL+'&field:Control1='+$feature.Control1+'&field:Gear1='+$feature.Gear1+'&field:parentglobalid='+UrlEncode($feature.GlobalID)+'">Link to App Survey</a>'

 

0 Kudos
ShanaGail1
Occasional Contributor

Oh nooo...  I had totally missed this issue of not being able to edit an existing feature using Survey123.  I had plans to incorporate this into the workflow for 2 different projects and need to come up a plan B quickly.  We really wanted to have the field inspector fill out a Survey.  Is there an elegant workaround?  Is the functionality in a project plan? 

Thanks,

Shana

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Shana,

I'm a little unclear - Survey123 can edit an existing record via the Inbox.  Are you asking about editing an existing feature via URL (somewhat implied by posting in this conversation)?  If so, that is not currently possible.  This is something that we do plan to support in the future.

0 Kudos
ShanaGail1
Occasional Contributor

Hi James,

Yes, I would like to edit an existing feature via URL.  The workflow is that a user clicks on an existing electric conductor using Collector, which then opens a survey by which they change an attribute of that existing feature.  The survey was created using that hosted feature service.

Since we can't do that, I have 2 questions -

* Do you have a workaround using a similar workflow?

* When is the functionality going to be supported?

Thanks,

Shana

Jean-SebastienLauzon
New Contributor III

Did you find a workaround? I'm trying to do exactly what you are describing.

Thanks!

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Jean-Sebastien,

Currently this is not supported in the field application.  You can specify editing a feature via the web application; see Survey123 Tricks of the Trade: Editing records in a web form

0 Kudos
by Anonymous User
Not applicable

Hi James,

Has this function been removed? I tried to do this the way you said but my guid field (and even the text field) always end up blank. I can see it in my url that it's getting sent but for some reason survey123 is not reading it.

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Gil,

The issue regarding guid formatting has been resolved, no work-around is needed.  Passing a GUID in is supported.  It sounds like your URL parameter may be set up incorrectly.

0 Kudos
by Anonymous User
Not applicable

Hi James,

This is how my URL parameter is set up:

var openSurvey = "arcgis-survey123://?itemID=68e2abce75cf4a0eaf68a661a9b52375"
+ "&center=" + lat + "," + lon
+ "&field:proj_num=" + $feature["proj_num"]
+ "&field:proj_name=" + $feature["proj_name"]
+ "&field:stn_comments=" + $feature["stn_comments"]
+ "&field:proj_province=" + $feature["site_province"]
+ "&field:station_id=" + $feature["stn_id"]
+ "&field:stn_latitude_col=" + lat
+ "&field:stn_longitude_col=" + lon
+ "&field:survey_guid=" + $feature.GlobalID

Another weird thing is if I open it from my webmap to Survey123 for Desktop, it's getting passed:

Webmap to Survey123 Desktop

But if I open it from collector on my phone to the Survey123 on my phone, nothing's there:

collector to survey123

Any ideas what's causing this?

0 Kudos
EvanOlivier
New Contributor III

Hello James,

I am creating a workflow that would do something very similar, with one important distinction.

We will be utilizing collector to gather inventory of a utility pole, and it's related table components that exist in one feature service with the Poles Feature Class and it's related component tables (Cross Arms, Insulators, etc). Then, we will be inspecting those assets in survey123 that is built from a different, existing feature service that contains an All Inspections Feature Class and the related Pole Component Inspection Tables (Pole Inspection, Cross Arms, Insulators, etc).

I've got the relationship classes down, indexing figured out and an appropriate guid field to pass the Global IDs of the Pole & it's attached components to, but have one major question I am concerned about now.

Say we have 2 cross arms on the pole, and I need to pass the two cross arm Global IDs that will show from the popup of the pole (pulled from the cross arm component related table) into two separate repeats within the PoleCrossArmInspections table(repeat) inside of survey. So Cross Arm A sends the Global ID into the CompRel_GlobalID Guid field of the first repeat in that table, and Cross Arm B sends that Global ID into the CompRel_GlobalID Guid field of the second repeat in that table.

Is this possible at all? If not, do you have any ideas for a work around? 

The structure of the relationships are established as this, with GlobalID being the parent keys and Rel_GlobalID being the foreign or child GUID keys. Then, there is a third relationship class that links the GlobalIDs of the Cross Arm Inventory Table (blue) to the CompRel_GlobalID GUID child or foreign key field of the Cross Arm Inspection Tables.

COLLECTOR    (Feature Service 1)                                                                                                              SURVEY123 (Feature Service 2)

Poles FC (Inventory of Poles) (GlobalID                                                                     All Inspections FC (GlobalID)
(Rel_GlobalID)-Related Table Cross Arms (GlobalID) -------->(CompRel_GlobalID)Related Table Cross Arm Inspections 

                                                                                                                                                                      (Rel_GlobalID)

Thanks for your consideration here.

Evan

0 Kudos