---
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


---

# 변환 맵에 onBefore 스크립트 추가

# 변환 맵에 onBefore 스크립트 추가 {#ariaid-title1}

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

소스에서 대상 인스턴스로 새 기록의 sys_id 복사하는 onBefore 변환 맵 스크립트를 하나 만듭니다. 두 번째 onBefore 변환 맵 스크립트를 만들어 고유 값은 같지만 sys_id 값이 다른 대상 인스턴스의 기록을 식별합니다.

## 시작하기 전에

필요한 역할: admin.

## 프로시저

1. 생성한 테이블 변환 맵 기록을 엽니다.
2. 변환 스크립트 관련 목록에서 새로 만들기를 클릭합니다.
3. 시기 필드에서 onBefore를 선택합니다.
4. 다음 스크립트를 입력합니다.  

       if (action == "insert") {target.setNewGuidValue(source.u_sys_id); }

5. 제출을 클릭합니다.
6. 변환 스크립트 관련 목록에서 새로 만들기를 클릭합니다.
7. 시기 필드에서 onBefore를 선택합니다.
8. 다음 스크립트를 입력합니다.  

       /** 
       * This script queries for a uniquely identifying value of the referenced record and then 
       * updates the target reference field with the sys_id of the matching target record.
       * This sample assumes:
       * 1) The target table contains an assigned_to field which is a reference field.
       * 2) The reference field references the User [sys_user] table.
       * 3) You can use the email field to uniquely identify users. Alternatively you
       *    could use the user_name field.
       */
       var ref = new GlideRecord("sys_user"); //Replace sys_user with any reference table
       ref.addQuery("email", source.email); //Replace email with any unique field
       ref.query();
       if(ref.next()){
          target.assigned_to = ref.sys_id; //Replace assigned_to with any reference field
       }

9. 제출을 클릭합니다.
**이전 주제:** [변환 맵 생성](https://servicenow-prod.fluidtopics.net/DgXK5H1BW~EYS0d8VALRvA "변환 맵은 임포트 세트의 필드와 기존 ServiceNow 테이블의 필드(예: 인시던트 [incident] 또는 사용자 [sys_user]) 간의 관계를 결정하는 일련의 필드 맵입니다.")  
**다음 주제:** [CSV 형식 파일에서 데이터 검색](https://servicenow-prod.fluidtopics.net/LNtgbWUz~2phf49gNKeRgA "이 방법에서는 HTTPS 데이터 원본을 사용하여 다른 인스턴스에서 데이터를 임포트하여 임포트할 행이 포함된 CSV 형식의 파일을 반환합니다.")

