How to hide label of multi row variable set

Yi Ming Song
Tera Contributor

Is there a way to hide the label of the MRVS?

8 REPLIES 8

@Yi Ming Song 

Do you still require this to be done even when DOM manipulation is not a best practice?

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

@Yi Ming Song 

if you still require then you can use onLoad catalog client script and set UI type - ALL

Ensure isolate script field is False so that DOM manipulation works. This field may not be on form but you can make it false from list

function onLoad() {
    //Type appropriate comment here, and begin script below
    setTimeout(function() {
        var searchTitle = "Servers"; // give the MRVS Title here
        if (window != null) {
            // native
            $j(document).ready(function() {
                $j('span').each(function() {
                    if ($j(this).text() === searchTitle) {
                        $j(this).hide();
                    }
                });
            });
        } else {
            var aTags = this.document.getElementsByClassName("sp-field-label-padding ng-binding");
            for (var i = 0; i < aTags.length; i++) {
                if (aTags[i].textContent.toString() == searchTitle) {
                    aTags[i].style.display = 'none';
                    break;
                }
            }
        }
    }, 3000);
}

AnkurBawiskar_2-1735554346617.png

 

 

AnkurBawiskar_1-1735553928717.png

 

Output: Working fine in both native + portal

hide label mrvs native portal.gif

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

@Yi Ming Song 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

@Yi Ming Song 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

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