Set Rich Text Value in client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-26-2020 12:58 AM
Hi Everyone,
I want to use client script to modify the rich text value in the Rich Text lanel type. Does anyone know how to implement it?
- Labels:
-
Service Catalog
-
Service Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-26-2020 06:57 AM
Hi,
then in that case you should be having Catalog Client Script.
can you share the complete script you are trying and what you want to achieve
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
‎10-26-2020 05:26 AM
Hi
As your field seems to be a CatalogVariable, please refer to the solved Community Article below an how to access Catalog Variables from Client Scripts:
g_form.setReadOnly('variables.VARIABLENAME', true);
Let me know if that answers your question and mark my answer as correct and helpful.
BR
Dirk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-26-2020 06:44 AM
Hi,
Yes, this is CatalogVariable, type is rich text label, name is banner, but i used g_form.setValue("banner"), g_form.setValue("bnnder.rich_text") and g_form.setValue("rich_texk"), none of these approaches will work. I used g_form.getValue("banner") and g_form.getValue("banner"), they both equal to empty string.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-26-2020 08:15 AM
Hi
WHat about
g_form.setValue('variables.banner','Some Value');
Let me know if that answers your question and mark my answer as correct and helpful.
Enjoy & BR
Dirk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-26-2020 08:34 AM
Hi,
Unfortunately, I just failed using this function.