Keyboard shortcuts

Press ← or → to navigate between chapters

Press ? to show this help

Press Esc to hide this help

Forms Code Editor와 코드 전용 필드

Code Editor는 폼의 YAML 구성을 보고 편집하는 도구입니다. 왼쪽 아래의 검은색 </> 버튼으로 엽니다. Visual Editor에서 필드를 만들거나 설정을 바꾸면 YAML에도 반영됩니다. 오른쪽 위의 책 아이콘은 편집기 안에서 예제와 설명을 엽니다.

폼 구조

최상위에는 name, fields와 sheets가 있습니다. 시트도 같은 구조의 옵션을 사용하며 필드에는 공통 옵션과 유형별 options가 있습니다.

name: New form
fields:
  - uri: name
    name: Full name
    type: Text
    options:
      placeholder: 'Last, First'
sheets:
  - name: New sheet
    fields:
      - uri: date_of_birth
        name: Date of birth
        type: DatePicker
        options:
          precision: day
      - uri: weight_kg
        name: Weight
        type: Numeric
        options:
          unit: kg

이 예는 이름을 기본 영역에 두고 생년월일과 몸무게를 하위 시트에 배치합니다. 저장할 URI는 실제 Fusion 열이나 온톨로지 속성 ID와 맞춰야 합니다.

공통 필드 옵션

키자료형의미
uristring고유 식별자. 저장할 값이면 Fusion 열 이름 또는 온톨로지 속성 ID와 일치해야 합니다. 저장하지 않는 값은 display.로 시작합니다.
typestringText, Numeric, DatePicker 등의 필드 유형
namestring화면의 레이블
urlParamstringiframe 등의 URL 입력으로 미리 채울 때 사용하는 쿼리 매개변수 이름
tagstring다른 필드에서 참조하는 별도의 고유 식별자. uri의 저장 매핑 제약과 다릅니다. 첨부 필드는 별도 참조 계약을 사용합니다.
helperTextstring필드 아래의 안내
infoTextstring레이블 옆 정보 툴팁
columnSpaninteger차지할 열 수
disabledBoolean읽기 전용으로 표시
hiddenBoolean표시하지 않지만 값을 기록
isBlockBoolean레이블을 왼쪽 대신 위에 표시
noLabelBoolean레이블 숨김. Code Editor에서만 설정
validatorslist<Validators>유효성 검사 목록
transformslist<Transforms>조건별 변환 목록

유형별 세부 값은 options 아래에 둡니다. 다음 예는 독립적인 폼 설정이며 서로 다른 폼 예제를 한 파일에 중복 최상위 키로 이어 붙이지 않습니다.

Hidden

보이지 않는 값을 기록합니다. val에는 저장할 문자열을 지정하며 다음 example-source는 예시 상수입니다.

name: Hidden value example
fields:
  - uri: Hidden
    name: Hidden
    type: Hidden
    options:
      val: 'example-source'

List

원래 다중 값을 지원하지 않는 필드를 여러 개 입력하도록 만듭니다. item에 원소의 type과 options를 지정합니다. 원소에서 지원하는 helperText, infoText와 validators 같은 공통 옵션도 사용할 수 있습니다.

name: Names list example
fields:
  - uri: names
    name: Full names
    type: List
    options:
      item:
        type: Text
        options:
          placeholder: 'Last, First'

options.allowZeroItems는 선택 사항이며 기본값은 false입니다. 빈 목록을 허용하려면 true로 정합니다.

Composite

여러 필드의 값을 하나의 JSON 문자열로 저장합니다. 내부 fields에는 각 필드의 URI와 유형 및 옵션을 정합니다. helperText, infoText, disabled, isBlock, noLabel과 validators 같은 지원 공통 옵션도 사용할 수 있습니다.

name: Composite information example
fields:
  - uri: info
    name: Composite
    type: Composite
    options:
      fields:
        - uri: date_of_birth
          name: Date of birth
          type: DatePicker
          options:
            precision: day
        - uri: weight_kg
          name: Weight
          type: Numeric
          options:
            unit: kg

Composite 안에는 Hidden이나 다중 값을 허용하는 필드를 넣을 수 없습니다. Composite 자체를 List의 원소로 사용하는 구성은 아래 예처럼 가능합니다.

ListAggregate

단일 값의 Calculation과 Template에 대응하는 다중 값 집계 필드입니다. 첫 예는 단일 선택과 여러 선택의 숫자 값으로 평균을 구합니다. 값의 문자열 표기를 그대로 사용합니다.

name: Selected values mean
fields:
  - uri: single_value
    tag: single_value
    name: Single Value
    type: RadioButtons
    options:
      options:
        - value: '10'
        - value: '20'
        - value: '30'
  - uri: multi_values
    name: Multiple Values
    tag: multi_values
    type: Checkboxes
    options:
      options:
        - value: '40'
        - value: '50'
        - value: '60'
  - uri: avg_value
    name: Average Value
    type: ListAggregate
    options:
      listOperation:
        operation: mean
        listTag: [single_value, multi_values]

다음은 이름과 점수를 가진 Composite를 List로 입력하고 점수들을 연결하는 예입니다.

name: Composite grades example
fields:
  - uri: grades
    tag: grades
    name: Grades
    type: List
    options:
      item:
        type: Composite
        options:
          fields:
            - uri: name
              name: Name
              type: Text
              options:
                placeholder: 'Last, First'
            - uri: grade
              name: Grade
              type: Numeric
              options:
                unit: '%'
  - uri: all_grades
    name: All grades
    type: ListAggregate
    options:
      listOperation:
        operation: concatenate
        joinWith: ', '
        listTag: grades
        displayItem: grade
options 설정의미
errorText선택적인 오류 문구이며 기본값은 빈 문자열
listOperation.operationconcatenate, sum, min, max, mean 또는 count
listOperation.listTag집계할 필드의 tag 하나 또는 tag 배열
listOperation.joinWithconcatenate에서 사용할 연결 문자열. 이 연산일 때 필요
listOperation.displayItemComposite 원소를 집계할 때 사용할 내부 필드의 URI

다중 값의 저장 스키마와 표시 전용 URI는 FAQ에서 확인합니다.