Dynamic link on Catalog item variable based on another variable

SUDEL
Kilo Guru

While searching the community for a quick answer for how to populate a dynamic masked link on a catalog item variable without using macros and widgets, i was not able to find much so posting this to help anyone who might need it.

Use Case: Add a link to another catalog while auto-populating  a variable on that catalog.

1. To add a dynamic link as a label you can use 'Rich Text Label' variable type.

2. Add 'Rich text' value as any default value which you want to show by default but want to change onChange.

3. Write a Onchange client script on the variable whose onchange you want to populate the values dynamically.

 

 Example script:

 

var url = this.window.location.origin.toString(); 
var detailslink = url + "/myit?id=sc_cat_item&sys_id=" + catalogsysid + "&sysparm_offering=" + encodeURIComponent(serviceoffering);
var myinstructions = '<a href=' + detailslink + ' target ="_blank">Click Here</a> to update';
g_form.setLabelOf('variable_name',myinstructions);

 

If you have better methods or any suggestions please post below.

 

0 REPLIES 0