HOW TO

Change the integer question type to text in a published survey

Last Published: July 19, 2023

Summary

Modifying a published survey question type and republishing it in ArcGIS Survey123 Connect may delete existing data in the process. However, it is possible to change the question type of a survey in ArcGIS Online without deleting existing data.

Procedure

Change the question type of a published survey from integer to text in ArcGIS Online, and republish it in ArcGIS Survey123 Connect. In this example, a question with the integer type (Floor Level) is updated to the text type.

  1. Optionally, make a copy of the existing survey data in ArcGIS Online.
    1. Log in to ArcGIS Online with the same credentials as ArcGIS Survey123.
    2. In the My Content section, navigate to the survey folder and open it.
    3. Identify the hosted feature layer of the survey. Click the More Options button More Option button. and select View item details.
    4. On the item details page, click Export Data > Export to FGDB.
    5. Specify a Title for the exported file and add one or more tags in the Tags section.
    6. Click Export.
  1. In ArcGIS Online, add a temporary string field in the survey.
    1. Navigate to My Content and open the survey folder.
    2. Identify the hosted feature layer of the survey. Click the More Options button More Option button and select Add to new map.
    3. In Map Viewer, open the attribute table of the layer. In the attribute table, click the Options button Option button and select Add Field.
    4. In the Add Field dialog box, specify a Field Name. In this example, the temporary Field Name is Temp. Ensure the Type is String.
    5. Click ADD NEW FIELD.
Add field
  1. Populate the newly added field (Temp) created in Step 2 with data from the existing numeric field (Floor Level) and delete the Floor Level field.
    1. In the attribute table, click the new field (Temp), select Calculate and click SQL. The Calculate Field dialog box opens.
    2. In the Calculate Field dialog box, under the Fields section, select Numeric. The numeric field, Floor_Level, opens in the Fields box.
    3. Click Floor_Level to formulate an expression in the Temp = section.
    4. Click CALCULATE.
Calculate Field pop-up
  1. Verify the populated values in the new field (Temp) are the same as the Floor Level field.
Temp field with newly populated value
  1. Delete the numeric field, Floor Level. In the attribute table, click Floor Level and select Delete.
  2. Click DELETE FIELD.
  1. Add a new string field, populate it with the value from the temporary field (Temp) and delete the Temp field.
  1. In the attribute table, click the Options button Option button and select Add Field.
  2. In the Add Field dialog box, specify a new Field Name. In this example, the field name is Floor_Level.
  3. Specify a Display Name, with the same name as the previously deleted field. In this example, it is Floor Level. Ensure the Type is String.
  4. Click ADD NEW FIELD.
Add field.
  1. In the attribute table, click the newly added field (Floor Level), select Calculate and click SQL. The Calculate Field dialog box opens.
  2. In the Calculate Field dialog box, under the Fields section, select String and click Temp.
  3. Click CALCULATE.
Calculate Field pop-up
  1. Delete the temporary field, Temp. In the attribute table, click the Temp field and select Delete.
  2. Click DELETE FIELD.
  1. In ArcGIS Survey123 Connect, update the question type in the XLSForm survey.
    1. Open the XLSForm of the survey.
    2. Identify the question with the modified field type in ArcGIS Online.
    3. In the type column, click the drop-down arrow next to the integer type and select text.
Integer typeText type.
Note:
Ensure the name and label columns in the XLSForm have the same values as the Field Name and Display Name specified in Steps 4(b) through 4(c).
  1. Save the XLSForm.
  1. Republish the survey.

The survey is updated with the Floor Level question type changed from integer to string. The existing data is preserved after republishing.

Updated survey

Article ID: 000022511

Software:
  • ArcGIS Online
  • ArcGIS Survey123 Connect

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options