I am using Survey123 for a Road Tour app. Part of that is calculating the square yards of a segment. Currently, I am successfully calculating the area with a "calculate" statement as displaying the result with a "note" statement. I have been unable to successfully format the result to an integer. I have tried input mask, but it is not an input and I tried "esriFieldTypeInteger" in the "bind::ersi:fieldType". The length and width are read from previous data with pulldata(). Any suggestions? Many thanx............ jt
Solved! Go to Solution.
Hi Jim,
You will need to manually apply the conversion to integer in the calculation. There are two functions that you could use:
- int() - transforms to integer by dropping the non-integer portion
- round() - rounds the result; using 0 as the number of decimal places will result in an integer
Hi Jim,
You will need to manually apply the conversion to integer in the calculation. There are two functions that you could use:
- int() - transforms to integer by dropping the non-integer portion
- round() - rounds the result; using 0 as the number of decimal places will result in an integer
Perfect! Thanx!
Now I want to take that result and multiply by a factor ( number of ways to do that) so that, in the screen shot above, it would show
Asphalt Overlay ~ $117,320 (which is $40 per sqr yard * total Square yards)
Chip Seal ~ $9,326 ( which is $3.18 per squ yard * total square yards)
etc.
Any suggestions there?
Hi Jim,
That shouldn't be an issue - if the number is hard-coded, you can include it in the calculation or as an additional calculation. It could also be a choice list or other question and then plugged into the formula by reference.
Hi James.... My query is more on utilization of real estate on the screen. What I have now is a select multiple other statement. Can I put a calculation into the options for the selection list? I have tried just adding ${var-name} in the label and that didn't work. Thanks much for your help!
Hi Jim,
Could you either share your form or display/describe the questions in more detail? I'm not sure how a select-multiple statement could be used in price calculations- you would normally need 1 price in the calculations.
Hi James.....
So after calculating the area, I want to list what some of the treatment options would cost as a discussion topic for those on the Road Tour. What is below works, but it doesn't look very good and uses alot of screen real estate. Idealy, the approximate costs could be part of the choices where the treatment is selected. Since I can't figure that out, I posted the costs as a group ( that could be shown or not) but there I can't format it so the calculated value was after the label.... eg. 2" Asphalt Overlay ~ $117k or 2"Asphalt Overlay ~ $117,320
Is that a little more clear? I can post the whole spreadsheet, but pointing out where I am working could be a bit of challenge. What do you suggest?
I really appreciate all you help.................. jt
Hi Jim,
Thanks for the example - this definitely helps. A couple of ideas:
Survey123 currently doesn't have support for dynamic label values - I'll log this as a possible enhancement
Hey James.... Thanks much... concat will put the dollar sign in front of the value. It will still display on two lines though, won't it? And there isn't a format mask that can be applied anywhere to add the comma after three digits.... (eg $2,345,678 vs $2345678)
Thanks again............ jt