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

Link has different solution. In my case, I should be able to show different messages in html with different fonts , color and font sizes.

HI,

Yes you can code that in that new widget which is associated with your variable. It has to be done based on variable change right?

 

Do you want to change html content of custom widget or Catalog item widget?


Thanks,
Ashutosh

1) Yes, that's right. Message in the HTML field of the widget should be changed based on one of the variable value selected in catalog item. I have associated the custom widget to a macro variable.

 

2) Right, I want to change HTML content of the custom widget. Each can have different fonts, colour of the font and font text. I am struggling to find how can this be achieved.

Like this.

If value is Red, then message is in Red

If value is Blue, then message is in Blue,

If value is Blue-Bold, then message is in Bold with blue color.