how to Set Rich Text (catalog variable) Value in client script? g_form.setValue() not work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2021 05:36 AM
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.
- Labels:
-
Scoped App Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2021 05:51 AM
Hi,
Are you using some UI page or UI macro to render that?
Please share some details such as screenshot etc
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2021 05:55 AM
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.
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!
Michael D. Jones
Proud member of the GlideFast Consulting Team!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2022 10:57 PM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2022 12:49 PM
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!