6.14 Import

The Import definitions and their example are shown below. For details about Import, see “Importing custom table records”.

(Table) Import definitions

Label Default value Required* Description
apiVersion: Yes API version
Specify 1.0.
kind: Yes Specify "import".
type: No Specify "resource".
It indicates a new definition to be added to the operational function of Ops I.
name: Yes Internal name of the Catalog definition.
"name" should follow the conventions shown below:
  • Specify the directory name of this YAML file.
  • The following characters can be entered:
    • Single-byte alphanumeric characters:
      a-z A-Z 0-9
    • Single-byte special characters:
      _ . ( ) -
  • The first character must be a single-byte alphanumeric character or an underscore (_).
  • For other precautions, see "Notes on creating YAML files" 2-4.
label: Yes Display name of the operational function to be written in the YAML file
description: No Detailed description of this YAML file
includes: No List the related YAML files for use in this YAML file.
TipsTips
  • Before this YAML file is registered, the YAML file to be written to must be registered in Ops I.
  • By specifying the "includes" label, you can import information defined in another YAML file. Specify the Datamodel YAML file that defines the custom table to import into.
- kind: Yes Type of YAML file to be loaded
  name: Yes Internal name of YAML file to be loaded
targetTable: Yes Table name of the custom table to import
The following characters are allowed:
  • Single-byte alphanumeric characters:
    a-z 0-9
  • Single-byte special characters:
    _
The first character must be a single-byte alphanumeric character (a-z). The number of characters allowed is up to 45.
columnMappings: Yes Mapping columns between the CSV file to be uploaded and the custom table
If inheriting from another table, define the parent table's fields here as well. For the default columns of the custom table, you can specify "id", "created_on", "updated_on", "created_by", "updated_by", and "sys_customer".
- source: Yes Column names in the CSV file to be uploaded
The following characters are allowed:
  • Single-byte alphanumeric characters:
    a-z 0-9
  • Single-byte special characters:
    _
The first character must be a single-byte alphanumeric character (a-z). The number of characters allowed is up to 63.
  target: Yes Table name of the custom table
The following characters are allowed:
  • Single-byte alphanumeric characters:
    a-z 0-9
  • Single-byte special characters:
    _
The first character must be a single-byte alphanumeric character (a-z). The number of characters allowed is up to 63.
  coalesce: false No Setting of the column identifiers for the CSV file to be uploaded
This is set to determine whether to update existing records or create new ones. If a record in the custom table has the same value as the column set as the identifier in the CSV file, that record is updated; if not, a new record is created in the custom table.
  • true: This is the identifier.
  • false: This is not the identifier.
The "coalesce:true" label must be specified for at least one column.
  validation: No Specify validation check.
- format: No Specify "regex".
  pattern: No Validation check format
Example:
"^[A-Z0-9-]+$"
*If a label that is not nested has its "Required" field set to "No", the definition is not required. For nested labels, the "Required" setting of a lower-level label applies only when the "Required" setting of its upper-level label is set to "Yes".

<Definition example>

apiVersion: 1.0
kind: import

## Meta data
type: resource
name: vm_import_definition
label: vm_import_definition
description: Import definition for the VM lending ledger table /  Import definition for the VM lending ledger table

## Include datamodel
## Include the datamodel manifest.

includes:
  - kind: datamodel
    name: rent_vm_datamodel

## Specify table name
## specify the table name

targetTable: rent_vm_table

## Field mapping
## mappings for the fields

  columnMappings:
    - source: "number"
      target: "app_number"
      validation:
         format: regex
         pattern:  "^[A-Z0-9-]+$"

    - source: "name"
      target: "vm_name"
      coalesce: true

    - source: "start"
      target: "start_date"

    - source: "end"
      target: "end_date"