- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2018 01:16 PM
I am trying to populate the description variable on a record collector form from an external URL. I am able to do so on a new Call form with the following URL:
https://<instancename>.service-now.com/nav_to.do?uri=new_call.do?sys_id=-1%26sysparm_query=description=this+is+the+description
which results in:
however, I'm unable to successfully pass it to a record collector for the New_Call table to the description variable. What am I missing? Can this be accomplished the same way with a sysparm_query? Any help would be much appreciated, thanks!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2018 02:13 PM
Or try below keeping the + sign
g_form.setValue('description',parm[1].toString().replace(new RegExp("\\+","g"),' '));
Please mark this response as correct or helpful if it assisted you with your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2018 01:21 PM
You said you are able to do it by the URL. Then what is the issue?
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2018 01:29 PM
The problem is I am trying to get the same result into a record producer and not a new Call record:
Adding %26sysparm_query=description=this+is+the+description to the URL for it does not populate the field shown above. The value for the variable is "description", however, I'm not certain how to refer to it being that it is a variable in a record producer rather than a field on a table.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2018 01:39 PM
You need an onLoad client script on your record producer to interpret it
var link = parent.window.location.href;
var hash = link.split('&');
var parm = '';
for (var i=0;i<hash.length;i++)
{
if (hash[i].indexOf('description')>-1)
{
parm = hash[i].split('=');
g_form.setValue('description',parm[1].toString());
}
}
And your link should be like this
/com.glideapp.servicecatalog_cat_item_view.do?sysparm_initial=true&sysparm_id=your record produver sysid&description=this+is+the+description
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2018 02:06 PM
Thank you very much Sanjjiv, this does pass the description into the variable. The only thing now is spaces are not being put in for + or %20, it's putting in literally what is after the "description=" in the URL (this+is+the+description). Do you know how to modify the onLoad client script to properly put in spaces and/or linefeeds ()?