- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
I’m trying to add a custom button on a Service Catalog Item and would like some guidance on the best approach.
I need to place a custom button on the Catalog Item form that will perform a specific action when clicked,
Example : Add a button called "Read Me", and redirect to an URL when click the button
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
You will have to use variable of type Custom and link a widget to it
That widget HTML will have a HTML button and you can then handle the URL logic
Something like this
1) widget
HTML:
<div class="form-group">
<button type="button"
class="btn btn-primary"
ng-click="c.readMe()">
Read Me
</button>
</div>
Client Controller:
api.controller = function() {
/* widget controller */
var c = this;
// Target URL you want to redirect to
c.readMeUrl = 'https://www.google.com';
// Action on button click
c.readMe = function() {
// Redirect current window to the URL
window.open(c.readMeUrl, '_blank'); // opens in new tab
// or use:
// window.location.href = c.readMeUrl; // opens in same tab
};
};
2) add this to variable of type custom
Output
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hey @pathumharsh ,
You can use a Rich Text Variable as per steps in screenshot
Step No.1: Create Varriable
Step No.2 : Add Link
Final Result:-
Kindly Mark Helpful
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hey @pathumharsh ,
You can use a Rich Text Variable as per steps in screenshot
Step No.1: Create Varriable
Step No.2 : Add Link
Final Result:-
Kindly Mark Helpful
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Thank you so much @Sadique Ali Kho
