How to remove hidden variable from multi-row variable set summary

imkhan
Tera Contributor

Hi All,

 

We have created some variables in the multirow variable set, and some of them hide, which hide the variable set form; however, they are not hiding from the summary of the multirow variable set.

I have applied all of the possible out-of-the-box solutions, but they do not work.

 

imkhan_0-1739984157486.png

 

 

Thanks,

 

3 REPLIES 3

Singha8
Tera Expert

Hi @imkhan 

 

To hide variable from the multi-row variable set summary, follow these steps to remove it.

 

1. Edit the multi-row variable set layout: Go to the variable set layout setting.

2. Customize the summary view: Find the column section that controls which variables appear in the summary and remove the hidden variable from the list.

3. Check the "display" setting: make sure the variable display option is "Unchecked" to hide it from the summary.

4. You can use client script (if needed)

 

Mark my response as helpful.

Thank you,

Ananya.

 

 

deepak81519
Tera Contributor

You can create an onLoad catalog client script to hide the columns. Please note it only works on the portal not on RITM.

 

function onLoad() {
    var COLUMN_TEXTS = ['Column1', 'Column2', 'Column3']; // add column names here

    // Wait until the MRVS table renders (it loads asynchronously in Portal)
    var attempts = 0;
    var maxAttempts = 40; // ~10s with 250ms interval - Increase the time based on portal loading time

    var poll = setInterval(function() {
        attempts++;

        var allHidden = hideColumns(COLUMN_TEXTS);
        if (allHidden || attempts >= maxAttempts) {
            clearInterval(poll);

            if (allHidden) {
                attachObserver(COLUMN_TEXTS);
            }
        }
    }, 250);

    // ---------------------------------------------------------

    function hideColumns(columnTexts) {
        var headers = this.document.querySelectorAll('th');
        if (!headers || headers.length === 0) return false;

        var hiddenCount = 0;

        for (var c = 0; c < columnTexts.length; c++) {
            var columnText = columnTexts[c];
            var targetHeader = null;

            for (var i = 0; i < headers.length; i++) {
                if (headers[i].textContent.trim() === columnText) {
                    targetHeader = headers[i];
                    break;
                }
            }

            if (!targetHeader) continue;

            targetHeader.style.display = 'none';

            var headerId = targetHeader.id;
            if (headerId) {
                var cells = this.document.querySelectorAll('td[headers="' + headerId + '"]');
                for (var j = 0; j < cells.length; j++) {
                    cells[j].style.display = 'none';
                }
            }
            hiddenCount++;
        }

        return hiddenCount === columnTexts.length;
    }

    function attachObserver(columnTexts) {
        try {
            var table = this.document.querySelector('table');
            if (!table || typeof MutationObserver === 'undefined') return;

            var observer = new MutationObserver(function() {
                hideColumns(columnTexts);
            });
            observer.observe(table, {
                childList: true,
                subtree: true
            });
        } catch (e) {
            /* ignore */ }
    }
}