From ff4a5ef99b9669d2f6857d2659810bd3a41d42b5 Mon Sep 17 00:00:00 2001 From: mits <104266846+mitalizope@users.noreply.github.com> Date: Mon, 20 Oct 2025 23:59:35 +0530 Subject: [PATCH 1/2] Create dynamic_label_update.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dynamically updates the label of a catalog variable based on another variable’s value. --- .../Dynamic Label Update/dynamic_label_update.js | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 Client-Side Components/Catalog Client Script/Dynamic Label Update/dynamic_label_update.js diff --git a/Client-Side Components/Catalog Client Script/Dynamic Label Update/dynamic_label_update.js b/Client-Side Components/Catalog Client Script/Dynamic Label Update/dynamic_label_update.js new file mode 100644 index 0000000000..aacbe87e56 --- /dev/null +++ b/Client-Side Components/Catalog Client Script/Dynamic Label Update/dynamic_label_update.js @@ -0,0 +1,8 @@ +function onChange(control, oldValue, newValue, isLoading) { + if (isLoading || newValue == '') { + return; + } + + var asset = newValue + ' Asset Name'; + g_form.setLabelOf('asset_name', asset); +} From ce3b909cec367e7c6e5faefeabe5bb83b6e5e8eb Mon Sep 17 00:00:00 2001 From: mits <104266846+mitalizope@users.noreply.github.com> Date: Tue, 21 Oct 2025 00:00:42 +0530 Subject: [PATCH 2/2] Create README.md --- .../Dynamic Label Update/README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 Client-Side Components/Catalog Client Script/Dynamic Label Update/README.md diff --git a/Client-Side Components/Catalog Client Script/Dynamic Label Update/README.md b/Client-Side Components/Catalog Client Script/Dynamic Label Update/README.md new file mode 100644 index 0000000000..c89c98ac56 --- /dev/null +++ b/Client-Side Components/Catalog Client Script/Dynamic Label Update/README.md @@ -0,0 +1,12 @@ +**Dynamic Catalog Variable Label Update** + +**Description** +This catalog client script dynamically updates the label of one variable based on the value of another. +It's useful when you want to provide contextual labels for dependent fields in Service Catalog items. + +**Example** +If Asset Type = "Software", then the label for "Asset Name" becomes "Software Asset Name". + +**Catalog Client Script Configuration** +- Type: onChange +- Variable name: asset_type