- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
I have a use case where , I need to trigger emails to user to request for new asset as their old asset is reaching end of life. So I have designed a scheduled flow to trigger notifications. This notification needs to have link to the catalog item, where the user can select for a different type of asset ,etc . I need to populate the old device details in the catalog form . I need to provide a link in notification. If user clicks on the link ,populate the old asset and its details in the catalog form.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hello @AnciaM ,
I would recommend you to use URL Parameters to Pre-populate like,
"https://<instance>.service-now.com/sc_cat_item.do?sys_id=<catalog_sys_id>&variable_name=value",
In your case you can use like this -> "https://dev12345.service-now.com/sc_cat_item.do?sys_id=abcd1234&old_asset_tag=ASSET001&old_model=Lap..."
and then in notification build a link to redirect
"<a href="https://dev12345.service-now.com/sc_cat_item.do?sys_id=abcd1234&old_asset_tag=${asset.asset_tag}&old...}">Request Replacement Asset</a>"
If my response helped mark as helpful and accept the solution..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi @AnciaM ,
In Your mail script wherever you are linking to catalog item just add extra param in that url as
https://your_instance_id.service-now.com/esc?id=sc_cat_item&sys_id='sys_id_of_your_catalog_item'&asset_sys_id='your_old_asset_sys_id'Use the following onLoad Catalog Client script to the parameter values from the URL
function onLoad() {
var oldAssetSysId =getParameterValue('asset_sys_id');
if (oldAssetSysId) {
//write your GlideAjax Script Include to get the whatever values you want from tha old asset and set those values to the current form using g_form.setValue()
}
function getParameterValue(name) {
var url = top.location.href;
var value = new URLSearchParams(url).get(name);
if (value) {
return value;
}
}
}if my response helps, mark my response as helpful and accept the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hello @AnciaM ,
I would recommend you to use URL Parameters to Pre-populate like,
"https://<instance>.service-now.com/sc_cat_item.do?sys_id=<catalog_sys_id>&variable_name=value",
In your case you can use like this -> "https://dev12345.service-now.com/sc_cat_item.do?sys_id=abcd1234&old_asset_tag=ASSET001&old_model=Lap..."
and then in notification build a link to redirect
"<a href="https://dev12345.service-now.com/sc_cat_item.do?sys_id=abcd1234&old_asset_tag=${asset.asset_tag}&old...}">Request Replacement Asset</a>"
If my response helped mark as helpful and accept the solution..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hello @AnciaM,
It looks like you have already implemented the notification part.
For pre-populating the catalog item with the old asset details, you can achieve this by passing the asset information as URL parameters and parsing them using catalog client script. You may refer to the below link for guidance on how to parse URL parameters in a client script: https://servicenowguru.com/client-scripts-scripting/parse-url-parameters-client-script/
Kindly Mark this as Helpful if it answers you question.
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi @AnciaM ,
In Your mail script wherever you are linking to catalog item just add extra param in that url as
https://your_instance_id.service-now.com/esc?id=sc_cat_item&sys_id='sys_id_of_your_catalog_item'&asset_sys_id='your_old_asset_sys_id'Use the following onLoad Catalog Client script to the parameter values from the URL
function onLoad() {
var oldAssetSysId =getParameterValue('asset_sys_id');
if (oldAssetSysId) {
//write your GlideAjax Script Include to get the whatever values you want from tha old asset and set those values to the current form using g_form.setValue()
}
function getParameterValue(name) {
var url = top.location.href;
var value = new URLSearchParams(url).get(name);
if (value) {
return value;
}
}
}if my response helps, mark my response as helpful and accept the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi there @AnciaM
In the notification, build the catalog URL with query parameters (for example, the old asset sys_id or asset tag). On the catalog item, use an onLoad Catalog Client Script to read those parameters (g_request.getParameter()), look up the asset on the server (via GlideAjax or Flow action), and populate the relevant variables.
Kind Regards,
Mohamed Azarudeen Z
Developer @ KPMG
