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
02-09-2022 02:19 AM
Sure! I've created a simple catalog item with 2 variables and a onChange catalog client script for this purpose. This is created on a new Rome instance I spun up an hour ago.
sImg URL is an empty input field and the Rich text label contains some dummy text.
The client script reacts to changes to the img url field and changes the label of the rich text label to print the img url and the image within a blue border.
Here's the form in Service Portal before anything has been input
Here's the form after i pasted a link to an image of my birthday dog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2022 06:34 AM
Hi,
I appreciate you taking the time to do that.
I'm assuming that this doesn't work on San Deigo. I upgraded my PDI prior to doing this, but it doesn't appear to work on San Diego.
Not sure if you've tried it there or not.
Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2022 11:58 AM
No worries! I haven't tried in San Diego yet. There were no available instances when I tried to spin one up unfortunately. I'll see if I can get hold of one of our vendor instances and give it a go there sometime soon.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2024 12:01 AM - edited 03-01-2024 12:02 AM
Just tested this in Vancouver and it's working in Service Portal. Thanks for the idea Håkon!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2024 04:12 AM
It does work in Xanadu 😉
If this answer was helpful, I would appreciate if you marked it as such - thanks!
Best
Daniel