How to get the image along the text from Rich Text Fields
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2022 04:42 AM
Dear Community,
I have requirement to get the the images as well from Rich Text Field(HTML), but by using .getDisplayValue() and .getValue() I am not able to fetch the images, only I am getting the text in it.
Is there any ways to get the images as well from the HTML field.
Note : This is for generating the pdf file using Document Template module.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2022 04:51 AM
Hi @Ratan B
If you are generating PDF Document using Document Template, you can directly embed your image on HTML. Also attach that image file on same Document Template record as attachment.
One you generate PDF using that Document template, it would automatically take image also. I dont see any requirement to use script here.
Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2022 04:56 AM
So you are mapping the field and the field is HTML type?
So how it's showing currently?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2022 05:43 AM
Now It is getting only the text value in it, not pasting the images which are available in the HTML field.
Field Value :
But the Thing which am able to get :