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

OnChange Client script on variable in a variable editor

shreyask
Kilo Contributor

Hi All,

Has someone found a solution to build a client script on change of value in a variable which is part of a variable editor?

Basically, I want to dynamically hide/display variables in a variable editor based on the change of value of a Numeric Scale type variable in the variable editor.

7 REPLIES 7

Ok.From Jakarta we have this new feature called "Applies on Target Records" available on client scripts as well as on UI Policies which allows you to do the validations on your target tables. But if you are in previous version prior to Jakarta then you need to write a script include and a Client script to control the visibility of the variables in Variable editor as needed.



Please review the below thread where I have answered a similar query, you can use the same script with few changes as per your requirement, which should work for you.



Hide Variable Set in Variable Editor



Hope this helps.Mark the answer as correct/helpful based on impact.



Regards,


Shloke


Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Thanks Shloke, but wouldn't your solution work only when I load the form? I wanted to hide/display variables as soon as user selects an option in a variable in the variable editor (onChange) without having to save or reload the form.


servicenowavina
Tera Contributor

Can client script work on variable editor formatter?

I am using variable formatter on form but the client script which is applied on catalog item is not working in variable editor formatter.