Passing Global ID from Collector to Survey 123 Issue

3105
9
12-31-2019 08:41 AM
KitJones
New Contributor II

Using the steps outlined here I am trying to create a point in Collector and fill in the attributes in Survey123. https://community.esri.com/thread/208613-pass-global-id-from-collector-to-g#

However when I try to publish a form in Survey123 I get the message “The custom feature service submission url is not compatible with this survey (Field not found in the feature service:1)”

All of the other fields can be successfully uploaded.  I only have an issue when I try to add the Global ID fields. My URL link includes the Global ID.

0 Kudos
9 Replies
Shwu-jingJeng
Esri Regular Contributor

Hi Kit,

Could you provide more information on how the feature service is compopsed?

Do you use egdb such as Oracle or SQL server with the feature service?

You could also generate a log to capture the failure when published the survey and upload the log file, along with your xls form here for us to identify the issue further.

Capture log

Thanks,

0 Kudos
KitJones
New Contributor II

I've attached the xls form.  The survey is in Survey123 Connect for ArcGIS and I'm not finding instructions to begin logging anywhere using the desktop version. If you can point me in the right direction I will upload a log file. The feature service is from a feature class uploaded from a GDB.

0 Kudos
Shwu-jingJeng
Esri Regular Contributor

From survey123 Connect, click the burger icon and click the Setting.

Then go to Diagnostics to enable the logging. Now try to publish the survy again to capture the log.

0 Kudos
KitJones
New Contributor II

OK here it is.

0 Kudos
Shwu-jingJeng
Esri Regular Contributor

Hi Kit,

Looking at the log error, the field "GID" is missing in the layer "Ceramic" of your feature service.

Could you check your feature service to see if you have the field "GID" existed?

Did you follow the same steps to add the two fields in the xls form from the post you reference?

  • 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}

Could you take a screenshot of the fields with your "Ceramic" layer so that we can do a comparison of the fields with your xls form?

0 Kudos
KitJones
New Contributor II

Attached are the fields in the features class including the GlobalID field. I'm using the following custom URL to reference the global id. : a href="arcgis-survey123://?itemID=d4d86c45e674449fb3143c26e81a70f5&field:GID={GlobalID}&field:CP_EAST={CP_EAST}&field:CP_NORTH={CP_NORTH}&field:TYPE={TYPE}&field:ART_COUNT={ART_COUNT}&field:RIM={RIM}&field:PDROP={PDROP}&field:UTILIZED={UTILIZED}&field:MEND_HOLE={MEND_HOLE}&field:Device={Device}&field:COMMENT={COMMENT}&field:CN={CN}&field:CN_Num={CN_Num}">

I believe I followed the steps you set you, to only difference may be in this step: 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})

Subing GID for brdg_guid_text.

The instructions I was originally following say to reference the first field in the regex calculations:

  • The first field (let's cal it "incoming") should be a hidden field (or text, if you want to validate that it's receiving the value) that has a fieldType null (so it isn't submitted to the database.  In your case, using an existing feature class, this would be added if you have Survey123 create a form based on the feature class
  • The second field (parentglobalid) will hold the value, minus any curly braces.  This can be a calculate (or again, text for validation checks) question with a formula like:
    if(regex(${incoming}, '^\{[\w\-]*\}$'), substr(${incoming},1, string-length(${incoming}) - 1), ${incoming})
0 Kudos
Shwu-jingJeng
Esri Regular Contributor

Hi Kit,

Based on the screenshot, the field "GID" does not exist in the feature service, and that's why the publish failed. The field name "GID" has to be presented in the feature service.

However, could you clarify what your workflow is? 

If you attempt to edit an existing feature you created by Collector in Survey 123 field app by using an URL scheme, this is not supported with current release. Creating a new record would work but not edit an existing feature though.

And a side note for this issue, the workaround for globalid brackets is no longer necessary as we had fixed the issue with the current release.

0 Kudos
KitJones
New Contributor II

I was under the impression I could pass the GlobalID under the name of GID through the custom URL, ie GID={GlobalID}.

The current workflow involves field workers creating a point through Collector then opening Survey123 through the custom URL to record data in a form, using tools not available in collector.  Field crews need to be able to see an overall map to navigate, hence the use of Collector.  And they will be recording in multiple feature services, switching between them.  We are trying to replace a custom Applet from ArcPad since ArcPad is being discontinued.   I was told I could use this work in a previous question https://community.esri.com/message/899159?commentID=899159#comment-899159

0 Kudos
Shwu-jingJeng
Esri Regular Contributor

Hi Kit,

Thanks for clarifying this issue. There are two issues here you are encountering:

1. Publish survey failed due to the missing "GID" field in the feature service. You will need to rename the "GID" field in the xls form to match the name "GlobalID" field in "Ceramic" feature service, so the scheme could match in both the xls form and the existing feature service.

However, the workaround to have the "incoming" and "guid" fields are no longer needed to pass the globalid in the URL link. Therefore, you can just remove the addtional "incoming" and "guid" fields in the xls form. Just make sure the fields in the future service match the fields in the xls form when you try to publish the survey using the "Ceramic" feature service.

2. If you attemp to edit the existing records (insteading creating a new record) you collected from Collector in Survey123 field app by using the URL scheme, this workflow is currently not supported. To workaround this, you can specify editing a feature via the web application; see Survey123 Tricks of the Trade: Editing records in a web form    

Based on your description of the workflow, you are using Survey123 field app, then the URL scheme won't work as mentioned above.

Hope this clarified your issues and questions.

0 Kudos