How can I open catalog item with pre-populated variables from link

Blair5
Tera Guru

I have an email being sent where I want to link to a catalog item. When the link to the item is clicked, I want it to open in our portal and populate 3 fields. I've seen several things on the community, but I'm having trouble trying to determine all the pieced needed to accomplish this. I've done something similar for when we used the CMS and order guides but that's been obsolete for several years now. Any help is greatly appreciated. Thank you.

1 ACCEPTED SOLUTION
5 REPLIES 5

I have this onload script:

 

function onLoad() {

//Use the 'getParameterValue' function below to get the parameter values from the URL

var rt = getParameterValue('sysparm_req_type');
var cItem = getParameterValue('sysparm_item');

g_form.setValue('req_type', rt);
g_form.setValue('cat_item', cItem);
}

function getParameterValue(name) {
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
var regexS = "[\\?&]" + name + "=([^&#]*)";
var regex = new RegExp(regexS);
var results = regex.exec(top.location);
if (results == null) {
return "";
} else {
return unescape(results[1]);
}
}

And I build the URL via a scheduled job that triggers and email and the URL looks like this:

 

https://<instanceurl>.com/self_service?id=sc_cat_item&sys_id=<sys_id of item>%26sysparm_req_type%3DC... 

 

and I get this page -- is there something I'm missing? Do I need to add something to the variables themselves? :

Hi Micahel, were you able to see my reply? I'm having some issues getting this to work.