Importing Data Using Import Sets - sys_import.do

Not applicable

I am trying to populate an import set that I have created using the sysparm_import_set_tablename parameter. However I am finding that new import sets are created when the script is run - the new import set has the same name as the existing import set but with an Upper case initial letter. I've also noticed that underscores are replaced with spaces. The new import set is populated with values but I can't then assign a transform map to that import set.

Could someone let me know where I'm going wrong? Are there any rules or guidelines available that I should know about?

many thanks
john naughton

8 REPLIES 8

hiranmayeesahoo
Kilo Expert

Hi,



When you are trying to import the data from sysparm_import_set_tablename parameter then it will create   a new data source and a new import set table with the name you have provided in the sysparm_import_set_tablename=<importset_tablename>.



So you can create an import set in servicenow instance with "importset_tablename" and create transform map on that import set table.So when you will try to import data through sysparm_import_set_tablename parameter it will create a data source but it will follow the same transform map as your table name is same.


I am seeing a new issue where I have existing Data Sources with Import Set tables and a remote import performing a POST to sys_import.do with sysparm_import_set_tablename= the existing Import Set Table name, sometimes a new DataSource is created. The Transform Maps still work since they are tied to the import set table, however I now have new duplicate Data Sources with (uploaded) appended to the lowercase names of the attached files.



It is inconsistant in this behavior, where the first Data Source I did this with does NOT create a new Data Source.



I am struggling to locate any reference to the sys_import.do other than a form with that name and a POST action in the create_import_set UI Page.



Any clues on how to make it not create a new Data Source if one already exists?



ANSWER: Found it. The newly created Data Source has a value in the File Path field. This field is not present on the Data Source form view for Attachment Data Source types. Once I copied the lowercase version of the filename into the File Path on the Data Source I wanted it to use, a new (Uploaded) Data Source is not created.


Hi Johnny,



I am having the same issue. Did you copy the file name before the (Uploaded) part in the File path field?



Thanks in advance,


Linda


copy in the exact file name, do not use spaces, and in lowercase. Include the file extension.