Survey123: Proper handling of esriFieldTypeGUIDs

368
2
Jump to solution
05-04-2018 11:25 AM
Highlighted
New Contributor III

Hi, I was hoping someone might be able to provide some insights into dealing with esriFieldTypeGUID fields.  I have an esriFieldTypeGUID geodatabase field, exposed by a survey form's bound esriFieldTypeGUID text field...but am getting an error submitting a form with this field populated.  Hopefully an easy one - but does this value need to be manipulated in the form before submitting?

An applyEdits directly works ok:
Thanks for any ideas.
Sam
Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Esri Esteemed Contributor

Hi Sam,

The issue revolves around whether or not the curly braces are supplied as an incoming value - Survey123 expects them not to be present, but some applications supply them.  To allow for the survey to accept either with curly braces or not, here's the workaround:

The survey should be designed with 2 fields to handle the globalid value:

  • 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).  
  • The second field (assetguid) 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})

View solution in original post

2 Replies
Highlighted
Esri Esteemed Contributor

Hi Sam,

The issue revolves around whether or not the curly braces are supplied as an incoming value - Survey123 expects them not to be present, but some applications supply them.  To allow for the survey to accept either with curly braces or not, here's the workaround:

The survey should be designed with 2 fields to handle the globalid value:

  • 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).  
  • The second field (assetguid) 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})

View solution in original post

Highlighted
New Contributor III

Thanks, James for clarifying the issue.  That workaround solves it.

Reply
0 Kudos