How to have redirect link on notifications?

Akki1
Tera Contributor

Hi,

I have a table u_groups with fields

grp_name

grp_type

I have build notification to send when record inserted where grp_type is empty

When the user receives the notification I want to add link  to redirect to a catalog item 'Group Changes' with some pre-selected options in catalog

The 'Changes' variable is radio button with 2 options Modify,Delete

I want Modify to be auto selected and The 'Group Title' variable  to be auto populated with the respective grp_name

2 REPLIES 2

Murthy Ch
Giga Sage

Hi @Akki1 

You can take the below solution as a reference and implement your scenario.

https://www.servicenow.com/community/developer-forum/how-to-set-field-value-in-existing-record-using... 

I haven't tested it but let me know if it doesn't work.

 

Thanks,
Murthy

Ahmmed Ali
Mega Sage

One solution:

 

have link URL as below in notification:

Catalog_ITEM_URL_OF_PORTAL&changes=modify&group_title=YOUR_GROUP_NAME

Ex: https://instance_name.service-now.com/sp?id=sc_cat_item&sys_id=bbe8a5961bbad410eaf198ec0a4bcb2b&chan... 

 

Create one widget:

Server script.

(function() {
/* populate the 'data' object */
/* e.g., data.table = $sp.getValue('table'); */

data.change_type = $sp.getParameter("changes");
data.groupTitle = $sp.getParameter("group_title");

})();

 

 

Client controller:

api.controller=function($scope) {
/* widget controller */
var c = this;
if(c.data.change_type == "modify"){
$scope.page.g_form.setValue("CHANGE_TYPE_VARIBLE", "MODIFY_BACKEND_VALUE");
}
if(c.data.group_title){
$scope.page.g_form.setValue("GROUP_TITLE_VARIABLE", c.data.group_title);
}

};

 

 

Create one variable on your catalog item with type as custom and update your widget name in widget field.

 

Thank you,

Ali

If I could help you with your Query then, please hit the Thumb Icon and mark my answer as Correct!!

Thank you,
Ali