How to insert data in the table using client script in service now?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2020 10:49 AM
Hi everyone,
I want to send the data of the incident to a particular endpoint with some secret key along with data.
I have build a UI which asks the user the secret key. I want to make a plugin/application which will
i)ask user for secret key (one time process)
ii)evertime a new incident is created then that secret key along with incident's data should be sent to a particular endpoint with post request.
How can I achieve this?
Is there any way to insert/fetch data into/from a table using scripts?
Please help.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2020 12:56 PM
There is no direct way to insert data into a table with a client script but; you could create a GlideAjax script include (set as client-callable) that would allow you to pass data from the client, call a script server-side where you could insert/update records. GlideAjax is typically used to return data to the client, but there's no requirement that you do so (just have an empty callback function).
Simple example of GlideAjax: https://docs.servicenow.com/bundle/orlando-application-development/page/script/ajax/topic/p_AJAX.htm...
You could, of course, also use the same type of process (GlideAjax call) to query and return whatever data you need from the server.
If this was helpful or correct, please be kind and click appropriately!
Michael Jones - Proud member of the CloudPires Team!
Michael D. Jones
Proud member of the GlideFast Consulting Team!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2020 09:44 PM
Thanks Michael,
I will try this out.