ERROR

ArcGIS Field Maps domain: com.esri.arcgis.runtime.error code 21. Invalid JSON

Last Published: February 14, 2024

Error Message

Attempts to display and edit feature layers in the ArcGIS Field Maps mobile app fail, and the error message below is returned in the exported error log file after selecting Share Error.

Error: 
Domain: com.esri.arcgis.runtime.error
Code: 21
Description: Invalid JSON.
Error message after selecting the Share Error option.jpeg

Cause

The web map contains a feature layer with an unsupported field type. ArcGIS Field Maps does not currently support the DateOnly, TimeOnly, and Timestampoffset field types.

Solution or Workaround

Remove the unsupported field type from the hosted feature layer in ArcGIS Online

In this workaround, unsupported field types are removed from the attribute table of the hosted feature layer in ArcGIS Online. In this example, the DateOnly field type is removed.

  1. In ArcGIS Online, click the hosted feature layer. On the item details page, click theĀ Data tab.
  2. In the Table view, delete the unsupported field type. Refer to ArcGIS Online: Delete a field for instructions.

The image below shows the DateOnly field removed from the feature layer in ArcGIS Online.

Deleting DateOnly field in ArcGIS Online.gif

Transfer the field values of the unsupported field type to another field in ArcGIS Pro

In this workaround, field values from the unsupported field type are copied and transferred to a supported field type to ensure the field values are retained in ArcGIS Pro. The field with the unsupported field type from the feature layer is removed before republishing to ArcGIS Online for use in ArcGIS Field Maps.

  1. Open the ArcGIS Pro project containing the feature layer.
  2. Create a date field to store the dates. In this example, the new field is named Date_T.
  3. In the Contents pane, right-click the feature layer and click Attribute Table.
  4. In the attribute table, right-click the newly created field, and click Calculate Field. In this example, the Date_T field is selected.
  5. In the Calculate Field window, specify the following parameters:
    1. For Input Table, ensure the layer selected in Step 3 is prefilled. In this example, the input table is Test.
    2. For Field Name, ensure the field selected in Step 4 is prefilled. In this example, the field name is Date_T.
    3. For Expression Type, select Python.
    4. For Expression, under Fields, double-click the field with the attribute data to be transferred to the Date_T field. In this example, the existing field with the DateOnly data type is Date_O. The expression is populated as follows:
    Date_T = !<Date_O>!
    1. Click Verify to validate the expression.
    2. Click OK to run the script.
    Calculated field window configuration.png
  6. In the attribute table, right-click the unsupported field type name and select Delete.
  7. Share the feature layer as a web layer to ArcGIS Online for use in ArcGIS Field Maps. Refer to ArcGIS Pro: Share a web feature layer using the default configuration for instructions and more information.

Article ID:000031889

Software:
  • ArcGIS Pro 3 0
  • ArcGIS Pro 3 1
  • ArcGIS Online
  • ArcGIS Field Maps Android
  • ArcGIS Pro 3 2
  • ArcGIS Field Maps iOS

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