GlideImportSetTable - Scoped, Global
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.
| 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.
| Name | Type | Description |
|---|---|---|
| columnLabel | String | Label of the GlideDateTime column to create in the Import Set table. |
| 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.
| 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 |
| 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.
| Name | Type | Description |
|---|---|---|
| None |
| Type | Description |
|---|---|
| Object | JSON object in the following format:
|
// 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"];