Integer startup url parameter formatting causing trouble in iOS

358
13
Jump to solution
07-06-2018 12:37 AM
Highlighted
New Contributor II

I launch Survey123 from Collector with this url passing an objectnumber into Survey123 with the url:

href="arcgis-survey123://?itemID=985fc4058b6d3dd3a491&field:OBJECTNUMBER={OBJECTNUMBER}

This OBJECTNUMBER is an integer, and is passed into a field in my survey that is of type esriFieldTypeInteger.

Problem: In iOS, this integer is formatted with a space as thousands separator inside the field in Survey123. When the survey is submitted, it seems that this formatted integer is not recognized as an integer by the feature service. No error message is given, but no value is written into this field. In Survey123 on Windows, this formatting does not occur, and everything works. 

Is there a way to avoid this happening in iOS?

1 Solution

Accepted Solutions
Highlighted
Occasional Contributor III

Hi Jostein,

In the Collector Web Map, have you the following checkbox turned on?

This may affect how the attribute is passed through to Survey123.

Mikie

View solution in original post

13 Replies
Highlighted
Esri Frequent Contributor

Hi Jostein,

Can you confirm what language your iOS devices are set to, and what locale you are using, ie do you use dot or comma for thousand separator?

Also, have you tried just submitting a simple new survey with integer question to see if successful, ie survey not launched from Collector. What are you setting the field type to in Survey123 form, seperate to what you have set the esri field bind type, and did you try setting the bind type column also?

One last thing is to try the latest version of Survey123 field app, 3.0. if you have not already updated.

Phil.

Reply
0 Kudos
Highlighted
New Contributor II

I use the 3.0 version of Survey123. iPhone uses Norwegian language and region settings. We don't really use a thousands separator, but I see that the iPhone is formatting numbers using a space to separate the thousands. Today, I tried this on an Android phone as well, and the same happens here

Submitting surveys works fine as long as this integer is not formatted with a space. When I launch it from Collector, I have to remove this space before submitting, then it's ok. Problem is that I want to set this field to read only.

When the integer enters the form and gets a thousands separator, the number turns red indicating that the content does not match the field in the form that is of type esriFieldTypeInteger. Nevertheless, I am able to submit the form without any error message from the app, and a record is added to the database without a value in this OBJECTNUMBER field. I think there should be a mechanism in the Survey123 app that prevents submission of the form when the input does not match the form's field types

In the Survey123 form, this field has type=integer, required=yes, bind::esri:fieldType=esriFieldTypeInteger

Jostein

Reply
0 Kudos
Highlighted
Occasional Contributor III

Hi Jostein,

In the Collector Web Map, have you the following checkbox turned on?

This may affect how the attribute is passed through to Survey123.

Mikie

View solution in original post

Highlighted
New Contributor II

Thanks, yes, this checkbox was turned on. Turning it off made it work 🙂

Highlighted
Occasional Contributor

Hello,

I am having a very similar if not the same problem.  I am trying to pass an integer value over to an integer question in survey123. A number that can be 8 or 9 characters in length. What happens is that when the url is used the last character is dropped and thousandth separator commas get added.  Survey123 does seem to be able to handle this.  I get an Invalid Integer Value message when i attempt to submit.  I have tried the offered solution above of making sure the add thousand separator checked off in the pop for the webmap but that has not fixed the problem. 

Josh

Reply
0 Kudos
Highlighted
Esri Esteemed Contributor

Hi Josh,

Are you using the latest (3.5) version?  That release includes a specific fix around the length of integers.

Reply
0 Kudos
Highlighted
Occasional Contributor

Hi James,

I've had some success and some failure. Yes I am running the very latest version.  I've been able to pass a fixed integer value from one survey to a second survey but when I try my ultimate end game of passing the field value it gives me the old not a valid integer error. The last part of my url is something like &Field:Location_ID={Location}. Both fields are integer type questions.   I've not messed with the bind type yet.  Both fields would normally get a number of 8-9 characters.

I've not been able to find any discussions yet about survey to survey but in my ignorance I was hoping it works the same as collector to survey.

Thanks,

Josh

Reply
0 Kudos
Highlighted
Esri Frequent Contributor

Hi Josh,

Are you using Collector to pass the values into Survey123? Have you tried disabling the thousand separator in Collect pop up configuration?

If this is not the workflow you are using, can you provide more information, and copy of your survey xlsx form, even a copy of the web map and feature service you are using to launch from, and the full URL you are put together?

Phil.

Reply
0 Kudos
Highlighted
Occasional Contributor

Phil,

I'm actually trying to do this 2 different ways to appease 2 different inspector groups. For the time being i'm concentrating on getting Method #1 up and running.

Method #1 

I want to be able to open the attached Right of Way survey from the attached System Patrol Survey all within Survey123 and pass over the Location_ID field to the Location field in the Right of Way survey.  I am attempting to use a URL that looks like this.  Both Location and Location_ID fields are integer fields.

arcgis-survey123://?itemID=fe8bc0d1f738450eb2a40f8b0e07a827&field:Survey_Type=Hazard_Tree&field:Location={Location_ID}

Hazard_Tree_Survey
Launch_Survey

Method #2

2) This is lower priority.  I want to be able to open the Right of Way Survey from the Collector app and pass over a LocationID field from a separate hosted feature to the Location field in the Right of Way Survey.  I have a webmap built from the Right of Way Survey feature service because some inspectors prefer Collector for navigating.  They want to be able to initiate a new survey when they select a pole and have the pole number go over to the survey.  I'm not sure how i would go about copying the webmap and service layer for you to see.

Thanks,

Josh

Reply
0 Kudos