How to import excel file from Mid Server to import set table in service now.

Community Alums
Not applicable

Hi Team,

Can you please let me know how can I import files from Mid Server to Service Now.

Mid Server will be present on host system. And Host will post data in excel format to the mid server.

How can I pull that file into service now. Is there any direct configuration that is available.

If no, then what all scripting that I have to do?

Please do not give link to service now guru. I have already checked it and there is no update set available and it is outdated.

Really appreciated if any one could help me with this. I need to do this as an urgent requirement.

Regards,

Sindhuja.

7 REPLIES 7

hi @sindhu21 

I had a same doubt where we need to write this script can you please explain me clearly...I had a similar requirement where I need to get a file on daily basis and need to post that file in servicenow

Devika3
Tera Guru

Hi Sindhuja,

Did you got a solution for this? If so can you please share those details with me.

Regards,

Devika.

Amit Bindal
Tera Contributor

Hi, 

 

I had a similar requirements and I implemented like below.

 

Solution 1:

1. Create ECC output queue to fetch csv file via schedule job.

var probe = SncProbe.get("Command");
probe.setName("cd <path to file directory> && cat example.csv | base64");
probe.create("<MID Server Name>");

 

2. Write a Business rule to attach file from ECC input queue to data source.

 

Solution 2: 

1. Create ECC queue to call Shell (Unix)/PowerShell (Windows) script via schedule job.

var probe = SncProbe.get("Command");
probe.setName("bash <path to dir> example.sh"); // Example for Unix Mid Server
probe.create("<MID Server Name>");

 2. Write shell script in Mid Server to attach file on data source via attachment API.

#!/bin/sh

curl '*' "https://<instance>.service-now.com/api/now/attachment/upload" --request POST --header "Accept:application/json" --user 'user':'password' --header "Content-Type:multipart/form-data" -F 'table_name=sys_data_source' -F 'table_sys_id=256febac1ba9e9507d3ceac7b04bcbf0' -F uploadFile=@/opt/service-now/dir/example.csv

 

Please like this answer if found helpful or ask questions if further help is required.

 

Thanks

Amit Bindal