- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2020 07:49 AM
Hello,
I have a UI action on a record that redirects to a catalog record producer (Pics below). I would like the values to auto-populate on the record producer, what would this code look like? Do I need to pass the values with the UI action? I'm kind of lost here, any help is appreciated.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2020 08:57 AM
Hi there,
This is about a Record Producer opened within the Service Portal, correct?
Don't have a really nice suggestion from the top of my mind. Though this works:
Obviously, you could pass the candidate sys_id for example in the url. And with GlideAjax retrieve other values you are after.
If not familiar with GlideAjax, see this article I published earlier this week: Client Side Scripting: Go for GlideAjax (with getXMLAnswer)!
So how did the addInfoMessage with the value from the URL got populated? I've just set up a quick and dirty onLoad Catalog Client Script:
function onLoad() {
var x = top.location.href.split('&candidate=');
g_form.addInfoMessage('==> ' + x[1]);
}
I do think this could be done better, just don't have an idea myself and this though is a way.
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
---
LinkedIn
Community article list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2020 08:57 AM
Hi there,
This is about a Record Producer opened within the Service Portal, correct?
Don't have a really nice suggestion from the top of my mind. Though this works:
Obviously, you could pass the candidate sys_id for example in the url. And with GlideAjax retrieve other values you are after.
If not familiar with GlideAjax, see this article I published earlier this week: Client Side Scripting: Go for GlideAjax (with getXMLAnswer)!
So how did the addInfoMessage with the value from the URL got populated? I've just set up a quick and dirty onLoad Catalog Client Script:
function onLoad() {
var x = top.location.href.split('&candidate=');
g_form.addInfoMessage('==> ' + x[1]);
}
I do think this could be done better, just don't have an idea myself and this though is a way.
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
---
LinkedIn
Community article list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2023 03:25 PM
Thanks Mark, your solution worked to solve my issue of passing values from a UI Action to a record producer in Service Portal.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2020 08:59 AM
You should pass only sys_id of this record to URL parameter as mentioned here , write a script include to get the required field values using sys_id as input.
You should call this script include in onload() client script and populate fields in record producer.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2020 09:12 AM
Hello,
It's possible, if you pass the values in the URL for the record producer as query parameters, and apply them in an onLoad script:
also refer below links It will help you.
How do you link to a record producer and pass some of the parameters in the url?
Is there a way to read URL parameters in Record Producer script?
Regards,
Harshal.