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

Dynamic widget HTML content

ServiceNow Adm1
Giga Contributor

Hi All,,

I have a requirement where I need to show different messages in widget with different fonts, text and colours based on a variable selection on the catalog item.

How can I update html content dynamically when variable value changes?

5 REPLIES 5

HI,

That is what the link specifies. That you can use $watch functionality in your custom widget along with g_form.getValue('variablename');

 

So if the variables value changes then it will trigger code in that watch function and you can read the value in that function. Depending upon that value you can change the CSS associated with your widget.


Thanks,
Ashutosh