---
sourceDocument: Xanadu 애플리케이션과의 통합 생성
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/ko-KR/xanadu/integrate-applications

 Release :

    - xanadu

ft:locale :

    - ko-KR

ft:publication_title :

    - Xanadu 애플리케이션과의 통합 생성

ft:clusterId :

    - crint

bundleId :

    - crint

workflow :

    - Creator


---

# JSON 파일 임포트 예시

# JSON 파일 임포트 예시 {#ariaid-title1}

* 릴리스 버전: Xanadu
* 
* 업데이트 날짜 2024년 08월 01일
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 소요 시간: 4분

이 예제에서는 다양한 유형의 JSON 데이터를 가져오는 방법과 각 행에 필요한 경로를 보여 줍니다. 임포트하는 JSON 파일은 다음 지침을 따라야 합니다.
파일 형식 데이터 원본을 만드는 방법에 대한 단계별 지침은 을 참조하십시오 [파일 형식 데이터 원본 만들기](https://servicenow-prod.fluidtopics.net/BaYLaamndt0X0wwcloIMgg "파일 유형 데이터 소스 기록을 생성하여 임포트 세트가 임포트해야 하는 데이터를 정의합니다.").

* 배열의 경우 JSON 각 행의 경로에서 `/incidents/incidents`와 같은 배열 루트 요소를 두 번 지정해야 합니다.
* JSON 파일은 [RFC-4627](https://www.ietf.org/rfc/rfc4627.txt)을 따라야 합니다. 예를 들어, 단일 쉼표는 다음 이름에서 값을 구분해야 합니다. 개체 내의 이름은 고유해야 합니다.
* `@element`, `[index]` 또는 `text()`와 같은 조건자뿐만 아니라 자식, 형제 또는 조상과 같은 Axis는 지원되지 않습니다.
{#json-data-source-examples__ul_u43_kqc_m1b}

## 단순 배열

* 각 행의 경로: `/incidents/incidents`
* 결과: 2개 기록

{#json-data-source-examples__ul_bt4_33r_5x}이 예제에서 각 행의 경로에는 배열 루트 노드 `/incidents` 가 두 번 포함됩니다. 이는 배열을 가져올 때 필요합니다.

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

## 두 번째 수준의 배열

* 각 행의 경로: `/problems/data/data`
* 결과: 3개 기록

{#json-data-source-examples__ul_xh4_43r_5x}이 예제에서 각 행의 경로에는 배열 루트 노드 `/data` 가 두 번 포함됩니다.

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

## 중첩 배열

* 각 행의 경로: `/problems/problems/data/data`
* 결과: 3개 기록

{#json-data-source-examples__ul_yzl_t3r_5x}이 예제에서 각 행의 경로에는 `/problems` 및 `/data`라는 두 배열에 대한 루트 노드가 두 번 포함됩니다.

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

## 자식(중첩된) 배열 지원 {#json-data-source-examples__limited-support-child-arrays}

기본적으로 import는 하위(중첩) 배열을 지원하지 않습니다. 데이터 원본 뷰에서 Discard Arrays(배열 삭제) 확인란의 선택을 취소하여 지원을 사용하도록 설정할 수 있습니다. 다음 표에서는 하위 배열 지원을 활성화 및 비활성화할 때의 다양한 동작에 대해 설명합니다.

    { 
      "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}

| 경로 | 어레이 취소 사용 | 비활성화된 배열 취소 |
|-|-|-|
| /응답/문서/문서 | 다음 열과 값으로 기록 하나를 생성합니다. * ID : id_val * 엘리먼트 어레이 : {} {#json-data-source-examples__ul_rjv_tt1_lhb}childrenArray 또는 anotherArray와 같이 레코드에 있는 배열은 임포트 테이블의 열로 생성되지 않습니다. | 다음 열과 값으로 기록 하나를 생성합니다. * ID : id_val * childrenArray : \[1, 2, 3\] * anotherArray : \[{"키1" : "값1"}, {"키1" : "값2"}\] * elementWithArray : {"childrenArray" : \[1, 2, 3\]} {#json-data-source-examples__ul_mzn_pt1_lhb} |
| /응답/docs/docs/anotherArray/anotherArray | 각각 하나의 열(key1)이 있는 두 개의 기록을 만듭니다. | 각각 하나의 열(key1)이 있는 두 개의 기록을 만듭니다. |
| /응답/docs/docs/childrenArray/childrenArray | 작동하지 않으며 Path는 배열의 값이 키-값 구조에 없기 때문에 항상 JSON 개체 오류를 참조해야 합니다. | 작동하지 않으며 Path는 배열의 값이 키-값 구조에 없기 때문에 항상 JSON 개체 오류를 참조해야 합니다. |
[표 1. 하위 배열 동작]

{#json-data-source-examples__table_apx_ct1_lhb}

## 고아 배열

* 각 행의 경로:
* 결과: 2개 기록
{#json-data-source-examples__ul_r3p_4l1_45b}

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

## 배열 대신 여러 요소

* 각 행의 경로: `/problems/problem`
* 결과: 3개 기록

{#json-data-source-examples__ul_mds_djr_5x}  
중요사항:  
이 형식은 권장되지 않습니다. JSON 파일은 객체 내의 이름이 고유해야 한다고 명시한 RFC-4627을 따라야 합니다. 대신 JSON 배열을 사용합니다.

    {  
       "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"
          }
       }
    }


