---
sourceDocument: Brazil Workflow Data Fabric
sourceDocumentLink: https://www.servicenow.com/docs/r/integrate-applications

 Release :

    - brazil

ft:locale :

    - en-US

ft:publication_title :

    - Brazil Workflow Data Fabric

ft:clusterId :

    - crint

bundleId :

    - crint

workflow :

    - Creator


---

# JSON file import examples

# JSON file import examples {#ariaid-title1}

Release version: Brazil  
Updated September 10, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 2 minutes to read
Summarize  
![AI sparkle icon](https://servicenow.com/docs/portal-asset/ai-sparkle-icon) Summarized using AI  
This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.  

## Summary of JSON file import examples

This content provides practical examples and guidelines for importing JSON files into ServiceNow, focusing on correctly specifying the JSON path for each row during import.
It explains common JSON structures, how to handle nested and multiple arrays, and important compliance with JSON standards (RFC-4627) to ensure successful data import.
Show full answer Show less  

## Key Guidelines for JSON Imports

* **Path Specification for Arrays:** When importing JSON arrays, the path for each row must repeat the array root element twice (e.g., `/incidents/incidents`) to correctly identify each record.
* **RFC-4627 Compliance:** JSON files should separate values with commas and have unique names within each object to avoid import errors.
* **Unsupported JSON Features:** Predicates like `@element`, index selectors, XPath axes (children, siblings, ancestors), and functions such as `text()` are not supported in JSON import paths.

## Examples of JSON Import Paths

* **Simple Array:** For a JSON array under `incidents`, use path `/incidents/incidents` to import multiple incident records.
* **Array in Nested Object:** For arrays nested under multiple layers (e.g., `problems > data`), the path repeats the array node twice (e.g., `/problems/data/data`).
* **Nested Arrays:** For JSON structures with nested arrays at different levels, include both array root nodes twice in the path (e.g., `/problems/problems/data/data`).
* **Orphan Arrays:** For JSON files consisting solely of an array without a root object, use the path `//` to import the records.
* **Multiple Elements Instead of Array:** This format uses repeated keys instead of arrays and is not recommended due to non-compliance with JSON standards and potential import issues.

## Handling Child (Nested) Arrays

By default, ServiceNow import does not support nested arrays within records. To enable importing of child arrays:

* Uncheck the **Discard Arrays** option in the Data Source configuration.
* Enabling this allows child arrays to be imported as columns containing array data or nested objects.

**Impact on Data Import Behavior:**

| Path | Discard Arrays Enabled | Discard Arrays Disabled |
|-|-|-|
| `/response/docs/docs` | Imports one record with standard fields; array fields like `childrenArray` are omitted. | Imports one record including array fields as JSON arrays or nested objects. |
| `/response/docs/docs/anotherArray/anotherArray` | Imports multiple records with fields from the array objects. | Same as enabled, imports multiple records with array object fields. |
| `/response/docs/docs/childrenArray/childrenArray` | Fails with "Path should always refer JSON Objects" error due to non-key-value array items. | Same failure as above. |

## Practical Implications for ServiceNow Customers

* Correctly specifying the JSON path is critical to importing the intended records and avoiding errors.
* Understanding when and how to enable child array support helps in importing complex nested JSON data.
* Adhering to JSON standards ensures smooth import operations and reduces troubleshooting time.
* Using recommended JSON structures (arrays instead of repeated keys) avoids unpredictable import outcomes.  
These examples demonstrate how to import various types of JSON data and the necessary
path for each row. JSON files that you import should follow these guidelines.
For step-by-step instructions on creating a File type data source see, [Create a File type data source](https://www.servicenow.com/docs/7FBzxv__70zydk8ZnHtJQA "Create a File type data source record to define what data an import set should import.").

* For JSON arrays, the path for each row must specify the array root element twice, such as `/incidents/incidents`.
* JSON files should follow [RFC-4627](https://www.ietf.org/rfc/rfc4627.txt). For example, a single comma should separate a value from the following name. Names within an object should be unique.
* Predicates such as `@element`, `[index]`, or `text()`, as well as Axis such as children, siblings, or ancestors are not supported.
{#json-data-source-examples__ul_u43_kqc_m1b}

## Simple array

* Path for each row: `/incidents/incidents`
* Result: 2 records

{#json-data-source-examples__ul_bt4_33r_5x}In this example, the path for each row includes the array root node `/incidents` twice. This is necessary when importing an array.

    {  
       "source":"HI",
       "incidents":[  
          {  
             "number":"INC0000001",
             "short_description":"Can't read email"
          },
          {  
             "number":"INC0000002",
             "short_description":"Error loading XML file"
          }
       ]
    }

## Array in 2nd level

* Path for each row: `/problems/data/data`
* Result: 3 records

{#json-data-source-examples__ul_xh4_43r_5x}In this example, the path for each row includes the array root node `/data` twice.

    {  
       "problems":{  
          "id":"0",
          "data":[  
             {  
                "number":"PRBTEST001",
                "short_description":"testsd1"
             },
             {  
                "number":"PRBTEST002",
                "short_description":"testsd2"
             },
             {  
                "number":"PRBTEST003",
                "short_description":"testsd3"
             }
          ]
       }
    }

## Nested array

* Path for each row: `/problems/problems/data/data`
* Result: 3 records

{#json-data-source-examples__ul_yzl_t3r_5x}In this example, the path for each row includes the root nodes for both arrays twice, `/problems` and `/data`.

    {  
       "problems": [  
             {
          "id":0,
          "data":[  
                {  
                   "number":"PRBTEST001",
                   "short_description":"testsd1"
                },
                {  
                   "number":"PRBTEST002",
                   "short_description":"testsd2"
                },
                {  
                   "number":"PRBTEST003",
                   "short_description":"testsd3"
                }
              ]
           }
        ]	
    }

## Supporting child (nested) arrays {#json-data-source-examples__limited-support-child-arrays}

By default, import does not support child (nested) arrays. You can enable support by
unchecking the Discard Arrays check box in the Data Source view. The
following table describes different behaviors when enabling and disabling child array
support.

    { 
      "response":{
        "docs":[ 
          { 
            "id":"id_val",
            "childrenArray":[1,2,3],
            "anotherArray":[{"key1":"value1"}, {"key1": "value2"}],
            "elementWithArray":{"childrenArray":[1,2,3]}
          }
        ]
      }
    }

{#json-data-source-examples__table_apx_ct1_lhb__entry__3}

| Path | Discard Arrays Enabled | Discard Arrays Disabled |
|-|-|-|
| /response/docs/docs | Creates one record with the following columns and values: * Id : id_val * elementWithArray : {} {#json-data-source-examples__ul_rjv_tt1_lhb}Any arrays found in a record, such as childrenArray or anotherArray, are not created as columns in the import table. | Creates one record with the following columns and values: * Id : id_val * childrenArray : \[1, 2, 3\] * anotherArray : \[{"key1" : "value1"}, {"key1" : "value2"}\] * elementWithArray : {"childrenArray" : \[1, 2, 3\]} {#json-data-source-examples__ul_mzn_pt1_lhb} |
| /response/docs/docs/anotherArray/anotherArray | Creates two records, each with one column: key1. | Creates two records, each with one column: key1. |
| /response/docs/docs/childrenArray/childrenArray | Does not work and returns a Path should always refer JSON Objects error because the values in the array are not in a key-value structure. | Does not work and returns a Path should always refer JSON Objects error because the values in the array are not in a key-value structure. |
[Table 1. Child array behavior]

{#json-data-source-examples__table_apx_ct1_lhb}

## Orphan array

* Path for each row: `//`
* Result: 2 records
{#json-data-source-examples__ul_r3p_4l1_45b}

    [  
       {  
          "number":"PRBTEST001",
          "short_description":"testsd1"
       },
       {  
          "number":"PRBTEST002",
          "short_description":"testsd2"
       }
    ]

## Multiple elements instead of an array

* Path for each row: `/problems/problem`
* Result: 3 records

{#json-data-source-examples__ul_mds_djr_5x}  
Important:  
This format is not recommended. JSON files should follow RFC-4627, which states that names within an object should be unique. Use JSON arrays instead.

    {  
       "problems":{  
          "title":"2 problems",
          "problem":{  
             "number":"PRBTEST001",
             "short_description":"testsd1"
          },
          "problem":{  
             "number":"PRBTEST002",
             "short_description":"testsd2"
          }
       },
       "problems":{  
          "title":"1 problem",
          "problem":{  
             "number":"PRBTEST005",
             "short_description":"testsd5"
          }
       }
    }


