Based on reference type of variable selection we need to display the link in below
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
we have software name variable is there and it's a lookup select box variable so based software name selection that software name related link we need to display like below
example :
software name: Auto Viewer & Editor
Link: companyportal:ApplicationId=720fb74b-3e24
This product is already available in Company Portal.
Click here to access it and install the product by yourself!
If you require installation support or need to install a specific version not available in the Company Portal, please select YES in the installation assistance question and specify the required version in the Description field.
software name: Task & Reminders
Link: companyportal:ApplicationId=fd83f41e-1b5039a9bcac
This product is already available in Company Portal.
Click here to access it and install the product by yourself!
If you require installation support or need to install a specific version not available in the Company Portal, please select YES in the installation assistance question and specify the required version in the Description field.
how we can archive this scenario through widget
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Hi @mani55
If this response addressed your question, please mark it as Helpful and accept it as the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
how many links are those?
if those are very limited you can create variables with those links and then show hide
what script did you start?
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
4 products and 4 link and also we need to through widget only we need to configure
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @mani55,
Implemented using:
- Custom mapping table
(u_software_portal_mapping) - Catalog Item
(Software Request Demo) - Lookup Select Box variable
(Software Name) - HTML variable
(Information) - Script Include
(SoftwarePortalHelper)
var SoftwarePortalHelper = Class.create();
SoftwarePortalHelper.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getSoftwareInfo: function() {
var software = this.getParameter('sysparm_software');
var gr = new GlideRecord('u_software_portal_mapping');
gr.addQuery('u_software_name', software);
gr.query();
if (gr.next()) {
return JSON.stringify({
link: gr.u_portal_link.toString()
});
}
return JSON.stringify({
link: ''
});
},
type: 'SoftwarePortalHelper'
});- onChange Catalog Client Script with GlideAjax
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || !newValue)
return;
var ga = new GlideAjax('SoftwarePortalHelper');
ga.addParam('sysparm_name', 'getSoftwareInfo');
ga.addParam('sysparm_software', newValue);
ga.getXMLAnswer(function(response) {
var data = JSON.parse(response);
var html = '';
if (data.link) {
html += '<div style="padding:10px;';
html += 'border:1px solid #d9534f;';
html += 'background:#fff5f5;';
html += 'margin-top:10px;">';
html += '<b>This product is already available in Company Portal.</b><br><br>';
html += '<a href="' + data.link + '" target="_blank">';
html += 'Click here to access it and install the product by yourself!';
html += '</a><br><br>';
html += 'If you require installation support or need to install a specific version not available in the Company Portal, ';
html += 'please select YES in the installation assistance question and specify the required version in the Description field.';
html += '</div>';
}
g_form.setValue('software_info', html);
});
}