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

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.

 

find_real_file.png

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.

find_real_file.png

Here's the form in Service Portal before anything has been input

find_real_file.png

Here's the form after i pasted a link to an image of my birthday dog

find_real_file.png

 

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!

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.

Just tested this in Vancouver and it's working in Service Portal. Thanks for the idea Håkon!

It does work in Xanadu 😉


If this answer was helpful, I would appreciate if you marked it as such - thanks!

Best
Daniel