---
sourceDocument: Xanadu API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# GlideImportSetTable - Scoped, Global

# GlideImportSetTable - Scoped, Global {#ariaid-title1}

* Release version: Xanadu
* 
* Updated August 1, 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read

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.
**Related concepts**   

* [GlideImportLog](https://servicenow-prod.fluidtopics.net/qNWk7yJGC8yDqUP2uVapVg#GlideImportLogAPI "The GlideImportLog API provides methods to write log entries directly to the Import Log [import_log] table.")
* [GlideImportSetRun](https://servicenow-prod.fluidtopics.net/DuUdB5QjbqzVKw9vNXpdgQ#GlideImportSetRunAPI "The GlideImportSetRun API provides methods to creates an Import Set Run record which the GlideImportSetTransformer API can consume.")
* [GlideImportSetTransformer](https://servicenow-prod.fluidtopics.net/58WsAVdtp1Sky5h7T0fw~Q#GlideImportSetTransformerAPI "The GlideImportSetTransformer API provides methods to create an Import Set Transformer object used to execute an Import Set Transform.")
* [GlideImportSetTransformMap](https://servicenow-prod.fluidtopics.net/FN6~ahvPtG3B7g~0D95WzQ#GlideImportSetTransformMapAPI "The GlideImportSetTransformMap API provides methods to create transform maps and transform entries.")
* [GlideTransformLog](https://servicenow-prod.fluidtopics.net/40hOpIutNqObDYC_~w8L~w#GlideTransformLogAPI "The GlideTransformLog API provides methods to create a GlideTransformLog object to log messages to localhost logs.")

## GlideImportSetTable - GlideImportSetTable(String tableLabel) {#ariaid-title2}

Instantiates a GlideImportSetTable object.
{#GImpSetTbl-GlideImportSetTable_S__table_xc4_sln_yjb__entry__3}

| Name | Type | Description |
|-|-|-|
| tableLabel | String | Label of the Import Set table created upon calling the create() method. |
[Table 1. Parameters]

{#GImpSetTbl-GlideImportSetTable_S__table_xc4_sln_yjb}  

    var importSetTable = new sn_impex.GlideImportSetTable("temp user table");

## GlideImportSetTable - addDateTimeColumn(String columnLabel) {#ariaid-title3}

Creates a GlideDateTime column.
{#GImpSetTbl-addDateTimeColumn_S__table_gj2_hs2_vjb__entry__3}

| Name | Type | Description |
|-|-|-|
| columnLabel | String | Label of the GlideDateTime column to create in the Import Set table. |
[Table 2. Parameters]

{#GImpSetTbl-addDateTimeColumn_S__table_gj2_hs2_vjb} {#GImpSetTbl-addDateTimeColumn_S__table_hj2_hs2_vjb__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 3. Returns]

{#GImpSetTbl-addDateTimeColumn_S__table_hj2_hs2_vjb}  

    var importSetTable = new sn_impex.GlideImportSetTable("temp user table");
    importSetTable.addDateTimeColumn('start date');
    var tableStructure = importSetTable.create();

## GlideImportSetTable - addStringColumn(String columnLabel, Number length) {#ariaid-title4}

Creates a string column.
{#GImpSetTbl-addStringColumn_S_N__table_arm_vr2_vjb__entry__3}

| 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 |
[Table 4. Parameters]

{#GImpSetTbl-addStringColumn_S_N__table_arm_vr2_vjb} {#GImpSetTbl-addStringColumn_S_N__table_brm_vr2_vjb__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 5. Returns]

{#GImpSetTbl-addStringColumn_S_N__table_brm_vr2_vjb}  

    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() {#ariaid-title5}

Creates the Import Set table.
{#GImpSetTbl-create__table_k5g_xs2_vjb__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 6. Parameters]

{#GImpSetTbl-create__table_k5g_xs2_vjb} {#GImpSetTbl-create__table_l5g_xs2_vjb__entry__2}

| 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. {#GImpSetTbl-create__ul_tgt_t52_vjb} {#GImpSetTbl-create__ul_ebc_ft2_vjb} {"tableName": "<table_name>", "tableLabel": "<table label>", "columns": StringMap(<column_label>: <column_name>)} |
[Table 7. Returns]

{#GImpSetTbl-create__table_l5g_xs2_vjb}  

    // 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"];


