The CreatorCon Call for Content is officially open! Get started here.

Collapse Variables on sc_req_item record

Puneet Hegde1
Tera Guru

Hi everyone,

I’m trying to make the Variable Editor (com_glideapp_servicecatalog_veditor) on the RITM form (table: sc_req_item) load with all containers (like User Info, Details, etc.) collapsed by default.

What I’ve tried so far:

  1. Created a system user preference with:

     
    <sys_user_preference> <name>sn_sc.VariablesEditorState</name> <value>collapsed</value> <type>string</type> <system>true</system> </sys_user_preference>

    — but this didn’t change the behaviour.

  2. Added an onLoad Client Script on sc_req_item:

     

    function onLoad() {
    (function collapseVE() {
    try {
    var ve = window.g_sc_form && window.g_sc_form.variableEditor;
    if (!ve) return setTimeout(collapseVE, 100); 


    if (Array.isArray(ve._sections)) {
    ve._sections.forEach(function (sec) {
    if (sec) sec.expanded = false;
    });
    }if (typeof ve.render === 'function') ve.render();
    } catch (e) {
    console.log('VE collapse failed:', e);
    }
    })();
    }

    — but the Variable Editor still loads expanded, and the script doesn’t seem to affect the initial state.

My goal:

When viewing an RITM, I’d like all variable containers to be collapsed by default (like how they appear when manually collapsed in the form), rather than fully expanded on load.

PuneetHegde1_0-1759847068619.png

 

Question:

Is there a supported or recommended way to make the Variable Editor load collapsed by default?

Any guidance would be much appreciated!

 

Thanks in advance,
Puneet

0 REPLIES 0