Survey123 Rating field type is String, I need Integer

1337
5
09-23-2021 01:13 PM
JayJohnsonWashoeCounty
Occasional Contributor III

I've designed a Survey123 form with the online design form.  I used the "Rating" widget to allow the user to rate an item from 1-5 stars.  The resulting data is formatted as STRING, even though it only contains integer values.  I'd like to display an AVERAGE rating value from this survey on a dashboard, but with the rating field formatted as STRING that isn't possible.  Can I somehow re-cast this field as an integer (maybe in a view?) so that Dashboard can get an average from it?

Jay
Washoe County GIS
0 Kudos
5 Replies
DougBrowning
MVP Esteemed Contributor

First try setting the bind esri type column to integer and see if that works.

If not create a second field that is integer with a calc of int(ratingfield).  Then set bind esri to null on the rating field and it will not go to the service so no one will know the difference.

Hope that helps.

0 Kudos
JayJohnsonWashoeCounty
Occasional Contributor III

Doug,

I was trying to stick with the web version of the survey designer, which doesn't give you that level of control.  The Rating question type in particular looks great when created with the web version, but you are stuck with the field format of String.  If you try to later edit that with Connect in order to change the field format to an Integer, the display of the question becomes less pleasing.

"Rating" question from web designer:

JayJohnsonWashoeCounty_1-1632498546308.png

Appearance of same question after editing esribindtype to integer with Connect:

JayJohnsonWashoeCounty_0-1632498319215.png

Connect doesn't seem to handle the "Rating" question type in quite the same way as the online designer...

So, under time pressure, I've just accepted that this is the way these questions have to look in order to get them to have an integer field type.  

Jay
Washoe County GIS
0 Kudos
DougBrowning
MVP Esteemed Contributor

If you can make hidden fields in the web builder then you can just use a second field with a calc of int(ratingfield).  You could also use the new data expressions in Ops Dashboard to convert it then.

Hope that helps

0 Kudos
jzibbell_boise
New Contributor III

I am realizing the same thing after publishing my survey. I thought I could do a hidden field too in the web builder app, but it doesn't allow me to calculate using the rating string field. I guess I'll try to open it in Connect and publish from there without breaking my survey that is already collecting responses. This seems like a bug and should be changed. 

0 Kudos
jzibbell_boise
New Contributor III

But AGOL can aggregate in Survey123 analytics, just not us in a Dashboard. Why?

jzibbell_boise_1-1675359472977.png

 

 

0 Kudos