Select to view content in your preferred language

Calculating from a text field after it's been submitted

593
3
Jump to solution
10-16-2023 02:44 PM
AbigailEbelherr
Occasional Contributor

I am using Survey123 Connect to create a ranking sheet for projects in a municipality.  I used ThierryGregorius' tutorial from this thread: https://community.esri.com/t5/arcgis-survey123-blog/using-formulas-in-survey123/ba-p/898169   For example, I have the following question:

What are the environmental impacts from this project?

  • Restores local ecosystem quality 
  • No significant impacts 
  • Negatively impacts local ecosystem quality

The labels are the answers while the name is the point value (3, 0, -3) assigned to each.  At the bottom, I have a field that calculates the score based off the answers.

However, what if the project changes or someone was just tired and clicked the wrong answer?  If I go into the Data tab and change the answer in the table, the value does not update accordingly.  I tried going into the data layer on ArcGIS online to calculate manually, and it would seem that the answers are stored as text and not numbers.  Is there a solution to this?  Or will we just need to create a new entry if we need to update the rankings?

0 Kudos
1 Solution

Accepted Solutions
ZacharySutherby
Esri Regular Contributor

Hello @AbigailEbelherr,

Editing the data directly in the table won't rerun any calculations since the calculation is on the Survey123 form level. In the Data tab of the Survey123 website when you select a record if you select the pencil icon on the top of the pane that displays on the right you will edit the record in the Survey123 web app.

ZacharySutherby_0-1697503440781.png

Editing here should either directly update the calculation or provide you with an option to recalculate the value. 

Thank you,
Zach

View solution in original post

3 Replies
ZacharySutherby
Esri Regular Contributor

Hello @AbigailEbelherr,

Editing the data directly in the table won't rerun any calculations since the calculation is on the Survey123 form level. In the Data tab of the Survey123 website when you select a record if you select the pencil icon on the top of the pane that displays on the right you will edit the record in the Survey123 web app.

ZacharySutherby_0-1697503440781.png

Editing here should either directly update the calculation or provide you with an option to recalculate the value. 

Thank you,
Zach
AbigailEbelherr
Occasional Contributor

Ok, that actually solves my situation neatly enough.  Thank you.

0 Kudos
MobiusSnake
MVP Regular Contributor
and it would seem that the answers are stored as text and not numbers

In your XLSX published from Survey123 Connect, check the bind::esri:fieldType value.  If you want your data to be stored as integers in ArcGIS Online, your questions' values in this column should be "esriFieldTypeInteger" or "esriFieldTypeInteger".

As mentioned by someone else, this won't fix your calculation issue though.