Error Message
Attempts to create new features or update feature edits in Map Viewer fail and return the following error message:
Error:
Something went wrong
Edits could not be saved: Error
Cause
- When creating new features, <Null> is specified in the attribute of the text field.
- In the feature's attribute table, <Null> is specified in the text field instead of the default null value. The image below shows <Null>, and the null value (blank space) in the attribute table.
The angle brackets '<>' in <Null> are read as HTML tags, thus 'Null' is read as a word instead of a null value. This causes formatting issues in Map Viewer.
Solution or Workaround
Exclude <Null> when creating new features
In Map Viewer, in the Create features pane, exclude '<Null>' from the attribute of the text field when creating features. Refer to ArcGIS Online: Edit features (Map Viewer) for more information.
Populate <Null> with null values using an Arcade expression
Note:
To apply this workaround, ensure the 'Keep track of changes to the data (add, update, delete features)', 'Keep track of who edited the data (editor name, date and time)' or 'Enable Sync (required for offline use and collaboration)' options are not checked under the Feature layer (hosted) section on the ArcGIS Online Settings tab.
- In ArcGIS Online, open the hosted feature layer item details page.
- Click the Data tab and select Table.
- In the Table view, click the header of the field and select Calculate.
- In the Calculate Field : <field name> window, click Arcade. The Arcade Calculator: <field name> window opens.
- Copy the following Arcade expression and paste it in the Expression box. Replace <field_name> with the selected field name and click Test.
if ($feature.<field name> == "<Null>"){
Return None
}
else {
Return $feature.<field name>
}
- When the Results tab displays the result, click OK.
The attribute table below shows <Null> replaced with the null value (blank space).