Create New Incident from URL with prefilled form Fields
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2017 09:11 AM
Hello. I am very new to using ServiceNow and we are looking for a way to create a new incident with some prefilled information located in the Summary and description fields.
I have the starting url that needs to be added to:
https://xxxx.service-now.com/cna/create_incident.do
But I am not sure how to construct the remaining portion of the url to get this to work.
I have inspected the elements on the page and have the ID of the fields I would like to populate but no matter what I try, it does not seem to be working. Any guidance you can get for this newbie would be extremely helpful.
Field ID's: u_incident_ess.u_summary
u_incident_ess.u_description
We are trying to integrate Salesforce, Guidewire, and other application platforms to be able to use a simple URL creation to create incidents with important information from the integrated systems to allow for better support. We realize that this could be done through some web service integrations however we feel this might be a better solution to meet our needs.
Thanks
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2019 10:43 AM
Hello, very brand new to servicenow. I have no admin access or am unable to create templates. I am trying to pre-populate the fields for our users. I want them to scan a QR Code and it would take them to the site with the fields pre-populated. Currently have this for my URL:
https://myitsupport.service-now.com/nav_to.do?uri=%2Fincident.do%3Fsys_id%3D-1%26sysparm_query%3D%5Eshort_description%3DShoulder%2520Tap%5Eassignment_group%3DService%2520Desk%5Ecaller_id%3Djavascript:gs.getUserID()
What am I doing wrong?
Thanks,
DSchiller

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2019 05:29 AM
The first thing that jumps out at me is the assignment group needs to be a sys_id. I like to build out the query on the list filter first with these values (even if there are no records that match the query) then click New to open a record with those values already populated. In your case, you'll need to switch the caller_id to the javascript:gs.getUserID() function call, but other than that it should work. Use the list filter> New trick to get you started.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2019 08:19 AM
FYI - A response to this post was featured on the Community Live Stream video. I invite you to watch the episode.
Video: Community Live Stream - 2019-10-23 - Developer Community - ServiceNow Community

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2020 09:52 PM
Is there a way to do a similar thing to update existing records?
For example, if I want to change the caller_id from sys_id=123 to sys_id=789, can I do that by passing parameters to the URL?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2020 05:28 AM
If you need to change the value on existing fields, you need to do a .setValue() method to assign a new value to that field. Just to be clear, do NOT assign a new value to the sys_id field. Your example of assigning a new value to the caller_id field would be something like:
var incGr = new GlideRecord('incident');
if (incGr.get('INCIDENT_SYS_ID_HERE')) {
incGr.setValue('caller_id', 'NEW_CALLER_ID_SYS_VALUE_HERE');
incGr.update();
}