Survey123 - strange error when trying to build survey from XLSforms

1686
7
Jump to solution
01-01-2018 09:16 PM
AnthonyCheesman1
Occasional Contributor II

Hello everyone and happy new year!

I'm starting out my new year by trying to build what should be a pretty simple Survey123 project. However, every time I try to build the survey I am receiving a strange error that I cannot resolve.

For context, I am using Survey123 Connect for ArcGIS (Version 2.3.24) and am using the 'Advanced' option.

Error as below:

The error is occurring on a couple of different fields. I don't think I'm doing anything too complicated - the fields I am getting issues on are:

1 - Record date / time. I would like this field to be hidden (using type = hidden), autopopulate with current date / time (calculation = now()). Using bind::esri:fieldType = esriFieldTypeDate

2 - Record lat / long of geopoint location. Both of these fields are hidden (type = hidden), calculation = pulldata("@geopoint",${LOCATION},"y") ("y" for lat and "x" for long). Using bind::esri:fieldType = esriFieldTypeDouble

The issue seems to relate to the bind::esri:fieldType column, as when I remove these values, the issue goes away. My understanding however is that as I would like these particular questions to be hidden, that I need to use this column.

Can anyone shed any light on this? Copy of the xlsforms spreadsheet attached for your reference.

Many thanks.

0 Kudos
1 Solution

Accepted Solutions
by Anonymous User
Not applicable

Hi Anthony,

You are still missing a closing curly bracket on your calculation here: if(${ACTIONED_YES_NO}='yes',now(),'')

Because of this missing bracket, the pyxform validator is misreading the calculation and when progressing on to your bind esri field type fields it is throwing the error at that stage, but the root cause is actually the missing bracket in the calculation.

Phil.

View solution in original post

7 Replies
by Anonymous User
Not applicable

Hi Anthony,

I had a quick look at your survey and noticed a few issues.

1. You are missing the now() function in Default column for OBS_DATE_TIME_UTC

2. Your calculation for COMPLETED_DATE_TIME is incorrect. It should be: if(${ACTIONED_YES_NO}='yes',now(),'')

Once you fix the above issues the form should work correctly. Your use of hidden fields and esri bind type parameters are correct.

Regards,

Phil.

AnthonyCheesman1
Occasional Contributor II

Hi Phil, thanks for the advice of yesterday.

I've applied the fixes you suggested (including updating to latest version) but unfortunately the survey is still not building. I am still getting error messages relating to the fields where I am using bind::esri options.

Any ideas what may be causing this? I'll attempt to attach an updated copy of the spreadsheet to the original post.

EDIT: updated spreadsheet actually attached to this post.

Thanks

0 Kudos
by Anonymous User
Not applicable

Hi Anthony,

You are still missing a closing curly bracket on your calculation here: if(${ACTIONED_YES_NO}='yes',now(),'')

Because of this missing bracket, the pyxform validator is misreading the calculation and when progressing on to your bind esri field type fields it is throwing the error at that stage, but the root cause is actually the missing bracket in the calculation.

Phil.

AnthonyCheesman1
Occasional Contributor II

Thanks Phil - I would have been chasing that for weeks!

All seems to be working very well now, many thanks.

by Anonymous User
Not applicable

Another thing to note is that the constraint you have used is incorrect. Setting .<255 will mean the value entered has to be less than the number 255.

The correct constraint is: string-length(.)<255

Regards,

Phil.

by Anonymous User
Not applicable

Forgot to mention, I also see you are using an old version of Connect. It is recommended to always use the latest version to ensure you are getting the latest bug fixes and feature enhancements. Currently both Connect and App are version 2.5.44. You can download the latest versions here: Survey123 for ArcGIS | ArcGIS 

Phil.

AnthonyCheesman1
Occasional Contributor II

Thanks Philip. I'll have a crack at this tomorrow morning and report back.

Really appreciate the quick response.