Creating incident from excel

simon8472
Kilo Explorer

Hello,

I want to creating incident from excel to Service Now?

I found solutions for Perl but I need to create incidents from excel using VBA. Is it possible?

Thank you in advance for your help

1 ACCEPTED SOLUTION

Bryan Tay3
Mega Guru

hi Simon,



u can refer to some of the article on internet to invoke webservices (REST) via VBA, then execute it from   excel/word etc.



VBA invoke REST webservices Call


https://www.experts-exchange.com/questions/28585692/How-do-I-open-files-saved-in-Microsoft-Onedrive-...



ServiceNow (enable http POST from other domain)


REST API CORS support



ServiceNow Get URL on rest syntax


REST API explorer



I had briefly tried one GET Record and it is working.


      Dim strPostResponse As String


      Dim objRequest As New MSXML2.XMLHTTP


      objRequest.Open "GET", "https://YOUR_SERVICENOW_INSTANCE_NAME.com/api/now/table/incident?sysparm_limit=1", False


      objRequest.Send strPostSting


      strPostResponse = objRequest.responseText


      MsgBox strPostResponse



Note: You will need to add reference to MS XML 3.0 (or any other version installed) in order for MSXML2.XMLHTTP objective being recognize in Excel VBA.



Hope this helps.


View solution in original post

2 REPLIES 2

Bryan Tay3
Mega Guru

hi Simon,



u can refer to some of the article on internet to invoke webservices (REST) via VBA, then execute it from   excel/word etc.



VBA invoke REST webservices Call


https://www.experts-exchange.com/questions/28585692/How-do-I-open-files-saved-in-Microsoft-Onedrive-...



ServiceNow (enable http POST from other domain)


REST API CORS support



ServiceNow Get URL on rest syntax


REST API explorer



I had briefly tried one GET Record and it is working.


      Dim strPostResponse As String


      Dim objRequest As New MSXML2.XMLHTTP


      objRequest.Open "GET", "https://YOUR_SERVICENOW_INSTANCE_NAME.com/api/now/table/incident?sysparm_limit=1", False


      objRequest.Send strPostSting


      strPostResponse = objRequest.responseText


      MsgBox strPostResponse



Note: You will need to add reference to MS XML 3.0 (or any other version installed) in order for MSXML2.XMLHTTP objective being recognize in Excel VBA.



Hope this helps.


Thank you for your help.