Zusammenfassung
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.
Vorgehensweise
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.
- Optionally, make a copy of the existing survey data in ArcGIS Online.
- Log in to ArcGIS Online with the same credentials as ArcGIS Survey123.
- In the My Content section, navigate to the survey folder and open it.
- Identify the hosted feature layer of the survey. Click the More Options button and select View item details.
- On the item details page, click Export Data > Export to FGDB.
- Specify a Title for the exported file and add one or more tags in the Tags section.
- Click Export.
- In ArcGIS Online, add a temporary string field in the survey.
- Navigate to My Content and open the survey folder.
- Identify the hosted feature layer of the survey. Click the More Options button and select Add to new map.
- In Map Viewer, open the attribute table of the layer. In the attribute table, click the Options button and select Add Field.
- In the Add Field dialog box, specify a Field Name. In this example, the temporary Field Name is Temp. Ensure the Type is String.
- Click ADD NEW FIELD.
- 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.
- In the attribute table, click the new field (Temp), select Calculate and click SQL. The Calculate Field dialog box opens.
- In the Calculate Field dialog box, under the Fields section, select Numeric. The numeric field, Floor_Level, opens in the Fields box.
- Click Floor_Level to formulate an expression in the Temp = section.
- Click CALCULATE.
- Verify the populated values in the new field (Temp) are the same as the Floor Level field.
- Delete the numeric field, Floor Level. In the attribute table, click Floor Level and select Delete.
- Click DELETE FIELD.
- Add a new string field, populate it with the value from the temporary field (Temp) and delete the Temp field.
- In the attribute table, click the Options button and select Add Field.
- In the Add Field dialog box, specify a new Field Name. In this example, the field name is Floor_Level.
- 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.
- Click ADD NEW FIELD.
- In the attribute table, click the newly added field (Floor Level), select Calculate and click SQL. The Calculate Field dialog box opens.
- In the Calculate Field dialog box, under the Fields section, select String and click Temp.
- Click CALCULATE.
- Delete the temporary field, Temp. In the attribute table, click the Temp field and select Delete.
- Click DELETE FIELD.
- In ArcGIS Survey123 Connect, update the question type in the XLSForm survey.
- Open the XLSForm of the survey.
- Identify the question with the modified field type in ArcGIS Online.
- In the type column, click the drop-down arrow next to the integer type and select text.
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).
- Save the XLSForm.
- 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.