GlideImportSetTable - Scoped, Global

  • リリースバージョン: Australia
  • 更新日 2026年03月12日
  • 所要時間:5分
  • The GlideImportSetTable API provides methods to create temporary Import Set tables.

    These methods create the Import Set table using a dynamic, standard naming convention. Tables must have at least one defined column. Modification and deletion of existing Import Set tables is not supported.

    A scheduled job named Scripted Import Set Deleter runs every seven days by default. Scripted Import Set Deleter deletes all Import Sets, Transform Maps, Transform Entries, and drops the Import Set Tables associated with the tables created by this API.

    You can use the GlideImportSetTable methods in global and scoped scripts. Use the sn_impex namespace identifier to create a GlideImportSetTable object.

    GlideImportSetTable - GlideImportSetTable(String tableLabel)

    Instantiates a GlideImportSetTable object.

    表 : 1. Parameters
    Name Type Description
    tableLabel String Label of the Import Set table created upon calling the create() method.
    var importSetTable = new sn_impex.GlideImportSetTable("temp user table");

    GlideImportSetTable - addDateTimeColumn(String columnLabel)

    Creates a GlideDateTime column.

    表 : 2. Parameters
    Name Type Description
    columnLabel String Label of the GlideDateTime column to create in the Import Set table.
    表 : 3. Returns
    Type Description
    void
    var importSetTable = new sn_impex.GlideImportSetTable("temp user table");
    importSetTable.addDateTimeColumn('start date');
    var tableStructure = importSetTable.create();
    

    GlideImportSetTable - addStringColumn(String columnLabel, Number length)

    Creates a string column.

    表 : 4. Parameters
    Name Type Description
    columnLabel String Label of the string column to create in the Import Set table.
    length Number Optional. Maximum column length.

    Default: 40 characters

    表 : 5. Returns
    Type Description
    void
    var importSetTable = new sn_impex.GlideImportSetTable("temp user table");
    importSetTable.addStringColumn('first name', 50);
    importSetTable.addStringColumn('last name', 50);
    var tableStructure = importSetTable.create();
    

    GlideImportSetTable - create()

    Creates the Import Set table.

    表 : 6. Parameters
    Name Type Description
    None
    表 : 7. Returns
    Type Description
    Object JSON object in the following format:
    • tableName: String. Database name of the table.
    • tableLabel: String. User-friendly label of the table (rewriteable).
    • columns: Object. Map of table column labels to column names provided by the addDateTimeColumn() and addStringColumn() methods.
      • column_label: String. Label of the string column in the Import Set table.
      • column_name: String. Name of the string column in the Import Set table.
    {"tableName": "<table_name>", "tableLabel": "<table label>", "columns": StringMap(<column_label>: <column_name>)}
    // Create Import Set table
    var importSetTable = new sn_impex.GlideImportSetTable("temp user table");
    importSetTable.addStringColumn('first name', 40);
    importSetTable.addStringColumn('last name', 40);
    importSetTable.addDateTimeColumn('start date');
    var tableStructure = importSetTable.create();
    
    /*
    tableStructure = {
    "tableName": "imp_staging_table_1417601730000",
    "tableLabel": "temp user table",
    "columns": {
    		"first name": "u_first_name",
    		"last name": "u_last_name",
    		"start date": "u_start_date"
    	}
    }
    */
    
    var importSetTableName = tableStructure["tableName"];
    var columns = tableStructure["columns"];