How to and example of calling a SQL server database to retrieve information to populate fields
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2023 09:27 AM - edited 06-16-2023 11:28 AM
How to and example of calling an non-ServiceNow SQL server database to retrieve fields of information from a table to populate fields within the ServiceNow input form. The initial input field to use within the SQL will come from the ServiceNow input form. We are using the Utah version of ServiceNow. Can anyone help me? I am really really green with ServiceNow.
So there should be an ServiceNow input form with at least three fields. The first field is input by a user and then we want to be able to call the routine to get the information from the non-ServiceNow database table and populate the other two fields on the input form with the retrieved table values. Something like an event when programming in VB or C#. How can I pull this off?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2023 05:56 PM
Hi, I would think that you would use an onChange client script (for the field that the user is populating) and use GlideAjax | ServiceNow Developers
to trigger a query to your target SQL solution (from your server 'ajax' script-include) and from this returning your results to the UI form via the Ajax call.
But exactly what\how will depend on your SNC instance configuration and your SQL solution, does your SQL solution support REST API?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2023 01:13 PM
I hate to be honest but we do not know if the SQL solution supports REST API but I want to believe that it does. I still do not know where in any of "My Apps" that I would place any of this GlideAjax though I am most glad that you shared this direction with me. When doing the exercise called "Build My First App Engine Studio Application" where does it instruct me to put in such scripts? I have completed it but I do not know where to start experimentally inputting GlideAjax. At present, it seems to go in a Flow within "Add logic or automation". I was hoping for a video that would walk me through a step by step process from beginning to end that was easy to follow and understand. I wish servicenow would provide such training along with its present training. I am going through another training now on GlideAjax but it is not a step by step from beginning of the application to the end. At present it looks to me that GlideAjax is used for querying records within the service now database(s) but I want to query a database that is on a third party and or our own servers that are not within servicenow. I guess that is why you mentioned the REST API but I still do not know where the code goes within the service now app.