Why Do Web App Calculation Outputs Increase/Decrease?

900
4
Jump to solution
09-29-2021 07:30 AM
JaredPilbeam2
MVP Regular Contributor

Hello,

In my XLSX form I have a simple calculation on an integer that converts cubic yards to tons. In Survey123 Connect it works absolutely fine. Ultimately, the survey will be used in the web app. Upon testing I noticed you can increase/decrease the value in the tons box on the web app survey. How do I remove this?

XLSX form showing calculation:

int1.png

Same elements in Connect:

int2.png

Same elements after publishing to web app. I circled the increase/decrease arrows in yellow:

int3.png

XLSX form is attached.

0 Kudos
1 Solution

Accepted Solutions
jcarlson
MVP Esteemed Contributor

Interesting that it's applying the "spinner" appearance without you specifying that.

Will users ever be adjusting tons without entering cubic yards? Will you be keeping both fields, or just using the calculation to get all the values into "tons"?

A possible option is to set the tons question to "text" (but leaving the bind::esri:fieldType as  esriFieldTypeInteger). Optionally, set the tons field to being read-only, if you don't intend on users changing its value, but simply defer to the calculation.

- Josh Carlson
Kendall County GIS

View solution in original post

4 Replies
jcarlson
MVP Esteemed Contributor

Interesting that it's applying the "spinner" appearance without you specifying that.

Will users ever be adjusting tons without entering cubic yards? Will you be keeping both fields, or just using the calculation to get all the values into "tons"?

A possible option is to set the tons question to "text" (but leaving the bind::esri:fieldType as  esriFieldTypeInteger). Optionally, set the tons field to being read-only, if you don't intend on users changing its value, but simply defer to the calculation.

- Josh Carlson
Kendall County GIS
JaredPilbeam2
MVP Regular Contributor

Hi Josh,

Thanks for the reply.

(1) The user should be able to enter a value for both cubic yards or tons.

(2) If the user enters a value in cubic yards it should be automatically calculated to tons.

(3) I don't want the user to be able to adjust the tons value.

I tried your first suggestion. I changed the type to text and set bind::esri:fieldType as esriFieldTypeInteger. Then I republished. No difference. The "spinner" is still there.

 

0 Kudos
IsmaelChivite
Esri Notable Contributor

Did you try setting the readonly XLSForm value to 'yes' in your calculated integer question?

IsmaelChivite_0-1632932983908.png

 

0 Kudos
JaredPilbeam2
MVP Regular Contributor

@IsmaelChivite 

I tried it, yes. But, it's not how I intend the survey to work. The user should have the option to fill out tons as well as cubic yards. It's only when they enter a cubic yards value that the tons value is automatically calculated.

To update my reply to @jcarlson's answer: I mistakenly looked at the wrong page of my survey. You might have the solution. There is no spinner, but I get a NaN in the tons box. That's better than a spinner, anyway.

int4.png

 

And now it's suddenly giving me multiple decimal places when before it was giving none. I'll have to look into that.

int5.png

0 Kudos