Change the Add Row Button title on MRVS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2021 11:53 AM
I was able ti inspect and find this element on a multi-row variable set
<h1 id="catalog_table_variable_dialog_title" class="modal-title h4"> Add Row <button class="btn btn-icon icon-help help"> <span class="sr-only">Help</span> </button> </h1>
I need to be able to change the label of my MRVS from Add Row to whatever the context of the Variable set is.
Example: I have a MRVS that requires users to Add RFCA Items, Add Clearance Approvers
How can I change the Add Row title for my mrvs to match what it is the user should be adding?
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2021 12:07 AM
Unless DOM manipulation is used you cannot achieve this
DOM is not recommended practice.
If you still require then you can use this onLoad Catalog client script
a) Applies to Catalog Item
1) Ensure Isolate Script field is set to false
2) This field is not on form but from list you can make it false
function onLoad() {
//Type appropriate comment here, and begin script below
setTimeout(function(){
var classDetails;
if(window != null){
classDetails = document.getElementsByTagName('button');
}
else{
classDetails = this.document.getElementsByTagName('button');
}
var k;
for (k = 0; k < classDetails.length; k++) {
var value = classDetails[k].innerHTML;
if(value == 'Add'){
classDetails[k].innerHTML = 'Add More Details';
break;
}
}
}, 3000);
}
Output:
Native:
Portal:
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2021 10:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2021 10:04 PM
Hi,
Then you will have to monitor the Add/remove button
sharing link here for help
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2021 06:58 AM
is there a way to change the label of a MRVS? in this example its software, if id like to make it something else, how do i script that?