how to Set Rich Text (catalog variable) Value in client script? g_form.setValue() not work.

Avinash_Patil1
Giga Guru

Hi, I am trying to create dynamic table using  Rich Text variable on catalog form, plz suggest on  how to Set Rich Text (catalog variable) Value in client script? g_form.setValue() not working.

11 REPLIES 11

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

Are you using some UI page or UI macro to render that?

Please share some details such as screenshot etc

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Michael Jones -
Giga Sage

Based on the info in the docs, setting the value is not supported in client-scripts for this variable type: 

  • The g_form.setValue()g_form.setReadOnly(), and g_form.setMandatory() APIs are not supported in catalog client scripts. Only the g_form.setVisible() API is supported.

https://docs.servicenow.com/bundle/paris-servicenow-platform/page/product/service-catalog-management...

You would likely have to resort to jQuery or DOM manipulation to achieve it, which would not be suggested. 

I hope this helps!

If this was helpful or correct, please be kind and remember to click appropriately!

Michael Jones - Proud member of the CloudPires team!

I hope this helps!
Michael D. Jones
Proud member of the GlideFast Consulting Team!

H_kon Sm_rvik
Kilo Expert

I don't know if this is still relevant to you but you can use g_form.setLabelOf('<field>', '<value>') to set the label text.

Hi,

Can you are more about this and demonstrate how you have this working for a rich text label as mentioned in the author's question. I don't believe this actually works and I wanted to double-check since you're saying it is and replying with this on a few different posts.

Thanks!

Please mark reply as Helpful, if applicable.


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!