Dynamic label on catalog form
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
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 updatesetTimeout(function() {g_form.setLabelOf('source_data', labelText);}, 300);}
O/p:
on RITM it is still showing label name "source_data"
Labels:
- Labels:
-
Service Catalog
0 REPLIES 0
