삽입다중

  • 릴리스 버전: Washingtondc
  • 업데이트 날짜 2024년 02월 01일
  • 읽기6분
  • URL을 대상으로 한 테이블에 대해 여러 개의 새 기록을 만듭니다.

    입력 필드

    insertMultiple 요소에는 시스템 필드를 제외한 대상 테이블의 모든 필드를 포함하는 1개 이상의 레코드 태그가 포함될 수 있습니다. 단일 작업에 삽입되는 기록 수를 200개 이하로 제한합니다. 증가가 인스턴스 성능에 부정적인 영향을 미치지 않는 경우 후속 내보내기를 통해 이 수치를 점진적으로 늘릴 수 있습니다.

    출력 필드

    insertMultipleResponse 태그 뒤에는 다음을 포함하는 1개 이상의 레코드 태그가 옵니다.

    표 1. 메서드 출력 필드 삽입
    테이블 유형 출력 필드
    정규 대상 테이블(table)의 sys_id 필드와 표시 값이 반환됩니다.
    임포트 세트

    임포트 세트 행의 sys_id, 변환된 대상 테이블(테이블)의 이름, 변환된 대상 테이블의 display_name, 변환된 대상 행의 display_value, 삽입, 업데이트됨 또는 오류를 포함할 수 있는 상태 필드.

    status=error경우 선택적 status_message 필드 또는 error_message 필드 값이 있을 수 있습니다.

    삽입으로 인해 대상 행이 변환되지 않은 경우(키 값이 지정되지 않아 건너뜀) sys_id 필드에는 대상 변환 테이블이 아니라 임포트 세트 행의 sys_id 포함됩니다.

    다중 변환이 있는 임포트 세트 이 유형의 삽입의 응답에는 multiInsertResponse 상위 요소에 래핑된 일반 임포트 세트 테이블 삽입의 여러 필드 세트가 포함됩니다. 각 세트에는 어떤 변환 맵이 응답을 작성했는지 보여주는 필드가 포함됩니다.

    일반 테이블에 대한 샘플 SOAP 메시지

    다음 예제에서는 짧은 설명만 지정하는 삽입을 보여 줍니다.

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:inc="http://www.service-now.com/incident">
       <soapenv:Header/>
       <soapenv:Body>
          <inc:insertMultiple>
             <record>
                <short_description>this is test 1</short_description>
             </record>
             <record>
                <short_description>this is test 2</short_description>
             </record>
             <record>
                <short_description>this is test 3</short_description>
             </record>
          </inc:insertMultiple>
       </soapenv:Body>
    </soapenv:Envelope>

    결과 응답은 다음과 같습니다.

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:inc="http://www.service-now.com/incident">
       <soapenv:Header/>
       <soapenv:Body>
          <insertMultipleResponse>
             <insertResponse>
                <sys_id>168160ad4a36231200a89091281dc803</sys_id>
                <number>INC0055180</number>
             </insertResponse>
             <insertResponse>
                <sys_id>1681622e4a36231200a8909115e5c388</sys_id>
                <number>INC0055181</number>
             </insertResponse>
             <insertResponse>
                <sys_id>1681626e4a36231200a89091fa3c0aa8</sys_id>
                <number>INC0055182</number>
             </insertResponse>
          </insertMultipleResponse>
       </soapenv:Body>
    </soapenv:Envelope>

    임포트 세트 테이블에 대한 샘플 SOAP 메시지

    다음 예제에서는 짧은 설명만 지정하는 삽입을 보여 줍니다.

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:imp="http://www.service-now.com/imp_notification">
       <soapenv:Header/>
       <soapenv:Body>
          <imp:insertMultiple>:-->
             <imp:record>
                <imp:message>one</imp:message>
                <imp:uuid>a</imp:uuid>
             </imp:record>
             <imp:record>
                <imp:message>two</imp:message>
                <imp:uuid>b</imp:uuid>
             </imp:record>
             <imp:record>
                <imp:message>three</imp:message>
                <imp:uuid>c</imp:uuid>
             </imp:record>
          </imp:insertMultiple>
       </soapenv:Body>
    </soapenv:Envelope>

    결과 응답은 다음과 같습니다.

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:imp="http://www.service-now.com/imp_notification">
       <soapenv:Header/>
       <soapenv:Body>
          <insertMultipleResponse>
             <insertResponse>
                <sys_id>1296b3ab0a0a0b5b73e966fbfab7acde</sys_id>
                <table>incident</table>
                <display_name>number</display_name>
                <display_value>INC0010033</display_value>
                <status>ignored</status>
                <status_message>No field values changed</status_message>
             </insertResponse>
             <insertResponse>
                <sys_id>1296b48e0a0a0b5b62513bb5974a7d96</sys_id>
                <table>incident</table>
                <display_name>number</display_name>
                <display_value>INC0010034</display_value>
                <status>ignored</status>
                <status_message>No field values changed</status_message>
             </insertResponse>
             <insertResponse>
                <sys_id>1296b58b0a0a0b5b468f534659538b9a</sys_id>
                <table>incident</table>
                <display_name>number</display_name>
                <display_value>INC0010035</display_value>
                <status>ignored</status>
                <status_message>No field values changed</status_message>
             </insertResponse>
          </insertMultipleResponse>
       </soapenv:Body>
    </soapenv:Envelope>