Import set table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-29-2022 04:17 AM
Hi guys,
I am trying to create import set table using script
var importSetTable = new sn_impex.GlideImportSetTable("Stage_table_81");
//var importsettable = new sn_impex.
importSetTable.addStringColumn('s_column', 50);
//importSetTable.addStringColumn('last name', 50);
var tableStructure = importSetTable.create();
But I got an error "Error: Stage_table_81 is not a valid table"
can you please help with it?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-30-2022 12:02 AM
Hi Alex,
If importing from outside ServiceNow, consider using Import Set API's POST method. There's a sample using curl command in the page. The POST can also be done with other methods like calling it from JavaScript, Python, PowerScript.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-30-2022 12:09 AM
Hi Alex,
Data can be imported into existing import set table using Import Set API's POST method. There's a sample using curl command in the page. The POST can also be done with other methods like calling it from JavaScript, Python, PowerScript.
As to creating a new import set table each time, I won't recommend it because it may create many tables and it would also require setting up transform map each time to import the data into ServiceNow table.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-30-2022 12:11 AM
If the data is going to be imported periodically, Scheduled Imports may be used.
If it needs to be pushed, would recommend considering using Import Set API.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-30-2022 03:30 AM
Hi Hitoshi,
Thanks for reply. But I have to create import set table to use it in my other scripts to import data.