Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

Dynamic label on catalog form

saisahithiA
Tera Contributor

I have written onchange client script where I am setting the label of a variable on runtime. based on the other variable selection . But in RITM it is still showing old label name. Please advise on this .
NOTE:

  • RITM displays variable names and labels based on the variable definition in the catalog item, not the dynamic label applied during form rendering.
  • g_form.setLabelOf() updates the UI only for the current session; it does not persist the label to the variable’s value or metadata.

    My Script:
    function onChange(control, oldValue, newValue, isLoading) {
        if (isLoading || newValue == '') return;

        var sourceValue = g_form.getValue('source_field');
        var labelText = '';

        if (sourceValue == 'AAA') {
            labelText = 'XXX';
        } else if (sourceValue == 'BBB') {
            labelText = 'YYY';
        } else {
            labelText = 'ZZZ';
        }

        // Smooth label update
        setTimeout(function() {
            g_form.setLabelOf('source_data', labelText);
        }, 300);

     
    }
    O/p:
    on RITM it is still showing label name "source_data"


 

 

0 REPLIES 0