- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2017 11:47 PM
Hi,
I need to pull the CSV file located on the MID server to the specific table in the ServiceNow.
Any suggestions?
Thanks
Ctirad
Solved! Go to Solution.
- Labels:
-
Best Practices
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-28-2017 07:45 AM
Hi,
finally I used an asset from ServiceNow Share which does exactly what I needed.
There were only some small changes required for running it on Istanbul version.
But after the changes it is working perfectly.
Ctirad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-08-2017 12:37 AM
Hi Citrad,
Solution 1
Following steps you can follow:
1) Have a folder in Mid Server to store the csv file
2) Send a command to Mid Server and send following parameters to mid server script include
a) sys_id of record to which attachment to be added
b) table name i.e. incident etc
c) admin credentials
d) folder name
3) Use attachment rest api to upload attachment from mid server java code is required in mid server
Solution 2:
1) Send command to Mid Server
2) Pick the file from mid server and using java code convert that file into base64encoded data
3) Once mid server returns back this base64encoded data have business rule on ecc_queue and use SOAP AttachmentCreator to add that as an attachment. AttachmentCreator SOAP message is out of box and it accepts table name, sys_id of record and base64 encoded data
The second solution may not work for large files since base64encoded data will be large for large file. But you can try both the approaches.
Links:
AttachmentCreator SOAP Web Service - ServiceNow Wiki
Attachment API - POST /now/attachment/file
Attachment API - POST /now/attachment/upload
REST Attachment API with Base64 String
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-08-2017 06:59 AM
Hi Ankur,
I am a newbie with ServiceNow so could you be more specific in your suggestions?
How I should do
"Send a command to Mid Server and send following parameters"
"Use attachment rest api to upload attachment"
"java code is required in mid server" - what code is required and where to implement it?
Thanks for help
Ctirad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-08-2017 07:14 AM
Hi Ctirad,
Java code can be written in Mid Server Script Includes. You will have to call that script when you insert a command in ecc_queue table.
https://www.servicenowguru.com/integration/scheduled-file-import-mid-server/
Also go through the earlier links I have shared.
JavascriptProbe and MID Server Script Includes | John Andersen
http://wiki.servicenow.com/index.php?title=MID_Server_Script_Includes_Reference#gsc.tab=0
There is an update set but not sure where is the download link for that. It is a ready made solution which can be directly done.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2017 01:30 AM
Hi Ankur,
thanks a lot for the hints you sent me.
The JavaScript probe would require the license for the orchestration and solution on ServiceNowGuru is payed (as I understand).
We might solve it by calling the POST command via the ECC queue in for the specific MidServer.
Regards
Ctirad