How to populate catalog item from an email notification

Luis Roman1
Tera Contributor

I have an email notification that in the body has an asset tag. In the email notification I put a hyperlink to a catalog item. The requirement is that when the user click on the asset tag, the catalog item is populated with the asset information so that customer just need to click on the submit to create a request, request item and a sctask. 

I need help on how to proceed to fulfill this requirement. Any guidance or article/blog or education on how to accomplish this? Need solution with JavaScript because I do not have knowledge on Widgets. 

Your expert guidance will be appreciated.

Luis

 

 

3 REPLIES 3

Saurav11
Kilo Patron
Kilo Patron

Saurav11, thank you for the article. I tried to use it but I am getting a browser error. Do you know how can I correct this error. 

The url that is: https://dev58970.service-now.com/sp?id=sc_cat_item&sys_id=4ef5c3a62fba511076795fd92799b6f7&sysparm_a...

The onload script is: 

function onLoad() {
//Use the 'getParameterValue' function below to get the parameter values from the URL
var asset = getParameterValue('sysparm_asset');
if (asset) {
g_form.setValue('asset', asset);
}
}

function getParameterValue(name) {
var url = document.URL.parseQuery();
if (url[name]) {
return decodeURI(url[name]);
} else {
return;
}
}

The browser error is: 

LuisRoman1_0-1667166597533.png

Your assistance will be appreciated.

Hello,

 

Are you getting this issue on Portal if yes that is because the document will not work in portal:-

 

Saurav11_0-1667301423947.png

 

Try the below:-

 

https://www.servicenow.com/community/developer-blog/adventures-in-service-portaling-populate-catalog...

 

Please mark my answer as correct based on Impact.