Populate reference field on record producer URL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2018 06:49 PM
I would like to use a URL to create and populate a record with predefined values. I am able to populate all fields on the new form with the exception of a reference field. I will be able to provide the number of the record associated with the reference field (i.e. INCxxxxxxx), but the field will only be populated when I supply the sys_id. Is there a way to convert the record number into the associated sys_id within the record producer URL?
Example
Works:
https://service-now.com/nav_to.do?uri=task_time_worked.do?sys_id=-1%26sysparm_query%3Dtask%3Dd25e4d22db725b048d067fda8c96191e
Does not work:
https://service-now.com/nav_to.do?uri=task_time_worked.do?sys_id=-1%26sysparm_query%3Dtask%3DTASK0191936

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2018 07:21 PM
How are you generating this link?
Not sure how this is all starting...like is this coming from a notification? Is a script generating this URL?etc?
If so, you can glide to the table, get the sys_id, then create and show the URL...
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2018 07:28 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2018 07:09 AM
This would be what you'd use for Incident...so convert this to work for Task:
sysparm_query=number=INC00040
Please mark reply as Helpful/Correct. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2018 01:10 PM
Maybe I'm not understanding correctly, but I am currently using a similar URL as to the one below to insert a new record in the time worked table. One of the fields that I'm populating via the url is a reference field to the task table. When I use the "sysparm_query=number" option, the reference field will remain blank, but when I use the sys_id, it populates. I would like a way to provide the task number to fill in the task reference field on the newly inserted form, instead of having to use the sys_id.
Works:
https://service-now.com/nav_to.do?uri=task_time_worked.do?sys_id=-1%26sysparm_query%3Dtask%3D18d068540f29a6000def563be1050eab
Does Not Work:
https://service-now.com/nav_to.do?uri=task_time_worked.do?sys_id=-1%26sysparm_query%3Dtask%3DINC0412228