Connection to Servicenow from VBA excel.

ashartaqvi
Kilo Explorer

I am developing a reporting tool in VBA excel(Macro) which requires connection with ServiceNow to fetch the Problem Records data as per the filters provided. This data can be fetched out in excel format to be used further by the macro. But I cannot find any API which can be used to do this connection with ServiceNow. Need help, if anyone has done anything on this before.

6 REPLIES 6

Hi Ashar,



I think you are nearly there with connecting into your instance with the ServiceNow ODBC driver.


After some helpful input from Victor and Probir.



You need to follow the instructions here to configure the DSN


Configuring the ODBC Driver - ServiceNow Wiki



2.2 Creating a New DSN

Using the ODBC driver and the ServiceNow data source, you can create an unlimited number of DSNs configured to connect with different instance URLs. This allows the flexibility of selecting the target instance for your ODBC connection by DSN name. As an option during installation or upgrade, you can elect to keep the DSNs when you uninstall.


  1. In Windows, navigate to Start > Programs > Service-now ODBC > ODBC Administrator.

..


                                  2.


To create a system DSN, select the System DSN tab, and then click Add.


odbc_dsn_add.png



The top level wiki is here, but you have I guess you have read most of that already.


ODBC Driver - ServiceNow Wiki



There is not really something like this available"


Set QCConnection = CreateObject("TDApiOle80.TDConnection")


QCConnection.InitConnectionEx "https://qualitycenter/qcbin"




However once you have installed and configured the ServiceNow ODBC Driver, and optionally validated with ISQL, you can use the DSN you have created,   so that   Excel for example, can query tables in the instance.


Using the ODBC Driver in Excel - ServiceNow Wiki


Assuming you have installed 32 bit ODBC driver if you want to use 32 bit Excel or 64 bit ODBC driver if you want to use 64 bit Excel.




Best Regards




Tony


altin
Kilo Contributor

Cdata Software has developed The ServiceNow Excel Add-In, which is a powerful tool that allows you to connect with live ServiceNow data, directly from Microsoft Excel. Use Excel to read, write, and update Schedules, Timelines, Questions, Syslogs, etc. Perfect for mass imports / exports / updates, data cleansing & de-duplication, Excel based data analysis, and more!



See how easy it is to use Macro (VBA) functions and Cdata Excel formulas at: CData Excel Add-In for ServiceNow 2016 - Macro (VBA) Functions