Anyway to upload an excel file via REST or SOAP and then utilized for import set??

jestep_97
Kilo Explorer

I would like to be able to "push" a file from an individual server to ServiceNow instance and then have it processed as an import set. Any way to do this??

15 REPLIES 15

reedwowens
Giga Expert

Use the Attachment API - POST /now/attachment/file to upload the file.


You can use a Scripted REST/SOAP service to perform the import.



You could also just post the file in a BASE64 string and just do the Scripted service.



If you know the servers with the file and don't mind doing it on a timed basis, you could do Import Sets with the file being retrieved via FTP/SCP/filecopy (UNC)/etc and have the retrieval happen through a MID Server.


Not sure that will work though, what am I going to attach it to?



And then I need to process it automatically and not reprocess.



I should say this is to upload specific details that will then be compared against current Configuration Items details. The file could include many CIs info


You could BASE64 Encode the file and send it as a parameter to your SCRIPTED service.   It would use a preexisting Import Set with a Datasource as Attachment.



Your script would just create the new attachment to the Data Source and remove the old one.   Then kick off the Import/Transformation.



Another method is to have the Import Set be retrieved via a MID Server using local FTP/SFTP/CP/SCP/Copy (UNC)/etc.


MID Server is out since they are not using it, but the other idea you mentioned is interesting.