How to get the image along the text from Rich Text Fields

Ratan B
Tera Contributor

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.

3 REPLIES 3

AnubhavRitolia
Mega Sage
Mega Sage

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.

 

 

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.

Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023

Ankur Bawiskar
Tera Patron
Tera Patron

@Ratan B 

So you are mapping the field and the field is HTML type?

So how it's showing currently?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Ratan B
Tera Contributor

@Ankur Bawiskar 

Now It is getting only the text value in it, not pasting the images which are available in the HTML field.

 

Field Value : 

RatanB_0-1669124534489.png

 

But the Thing which am able to get : 

RatanB_1-1669124593571.png