to set the value of "source code" of rich text label type variable in catalog item background script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2023 02:35 AM
I want to insert image in rich text label type variable of the catalog item from sys_attachment table dynamically.
I want to set the value of the source code of that variable using background script.
can someone help me with the script
note i want to set the value of the source code of the rich text label variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2023 06:36 AM
Hey @Sachin Gavhane,
Go to System UI > Images
Create an image here with a unique name to it:
Copy the HTML block.
The following code can be used to add an image to the Rich Text field.
var gr = new GlideRecord("sc_cat_item_producer"); // Your Table name
gr.get("68ba064e472031107e2d0178c26d439a"); // Specific Record
gr.description += "<img src='image_1.png' width='400' height='400'/>";
gr.update();
This approach can be used to attach the image in the Rich text field.
Kindly appreciate the efforts of community contributors by marking appropriate response as the correct solution and helpful, this may help other community users to follow the right solution in the future.
Thanks,
Hamza