Get image from URL and store record

SAM321
Tera Contributor

Hi all how to get an image from url in api and store in table form field.

The script include works for other but not for image. when its string field its showing url..I changed to image field type then,

Screenshot (173).png

Screenshot (174).pngScreenshot (170).png

How to get image 

1 REPLY 1

Sandeep Rajput
Tera Patron
Tera Patron

The API from which you are getting this information must be returning the image URL e.g. http://upload.wikimedia.org/wikipedia/commons/4/4a/Logo_2013_Google.png

 

You can store this URL and render it in your widget using img tag 

 

<img src="http://upload.wikimedia.org/wikipedia/commons/4/4a/Logo_2013_Google.png" alt="Google Logo" width="500" height="600">

 

Or you can find out an API which could download image from the URL and convert it to Base64 format which can be stored within ServiceNow's sys_attachment and sys_attachment_doc tables.