Change the Add Row Button title on MRVS

triciav
Kilo Sage

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?

9 REPLIES 9

Ankur Bawiskar
Tera Patron
Tera Patron

@triciav 

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);
}

find_real_file.png

find_real_file.png

Output:

Native:

find_real_file.png

Portal:

find_real_file.png

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

 

I am looking to change this after you click the ADD button

When the variables get listed the Add Row

 

find_real_file.png

 

 

Hi,

Then you will have to monitor the Add/remove button

sharing link here for help

https://community.servicenow.com/community?id=community_question&sys_id=8a612681db8d64103daa1ea66896...

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

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?