How To Construct links to forms with fields pre-populated

sherman_1206
Tera Contributor

I feel as though I have read an article before about how to do this. What I want to do is construct links to various forms on service now with data fields prepopulated.

For example, caller_id on incident I want to default to some person, or assignment_group I want to default to some group.

https://instance.service-now.com/incident.do?sys_id=-1&sysparm=assignment_group=7371ebb30a0a3c26002e...

Something along those lines which would set assignment group to the sys_id of the group in the link parameter. Is this possible and if so what parameter field do I need to populate with this data?

4 REPLIES 4

john_roberts
Mega Guru

When a record is created we use any existing query to load values. So you can specify the values in sysparm_query parameter.



incident.do?sys_id=-1&sysparm_query=assigned_to=9ee1b13dc6112271007f9d0efdb69cd0


This same logic can also produce unexpected results when using module or list filters then using the new button. For example, if you filter the incident list for incident state is closed, then click new, you will create a new incident with incident state of closed.


Thanks for the information much appreciated. The thinking behind this was to give different itil users a different "Create Incident" link on their left navigation. Some have default values, others do not. I believe this could be done with onLoad script as well but seemed easier to just construct the links instead of writing another client script.

See any pitfalls to that use case?


I use this method all the time. With a module you don't even have to construct the URL.
See this article for details.
http://www.servicenowguru.com/service-now-general-knowledge/populating-default-values-url-module/

You may also consider using templates to meet this same need.


Thanks both for the replies. Very helpful. Sometimes I find links and lose track of them but know theres information out there.