
- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 01-19-2021 11:04 PM
we are about to post base64 Encoded string to image type field
step-1 : lets create a image type field on incident form with the following configurations
step-2 : Select any image that you want to post to the above field, and navigate HERE to convert image to base64 encoded string. keep the browser tab open we will need the above base64 encoded string later on.
step-3 : here is the endpoint which we will use to post base64 encoded string directly to the image type field, https://yourInstanceName.service-now.com/api/now/table/ecc_queue
we will use post man for chrome to post base64 encoded string
endpoint details
METHOD : POST
BODY : application/json
BODYTemplate :
{
"agent":"AttachmentCreator",
"topic":"AttachmentCreator",
"name":"u_profile_photo:image/jpg",
"source":"incident:7b3e4a7cf0212300964feeefe80ff04b",
"payload":"/9j/4AAQSkZJRgABAQEBLAEsAA"
}
keep the agent and topic as AttachmentCreator
name: you should provide field name here to which you want to post an image. here our field name is u_profile_photo and after colon provide image type.
source: source will contain a colon separated table name and sys_id of a record to which you want to post an image.
payload: this is our base64 encoded string that we need to pass here.
step-4: lets start building the above request using post man.
keep the Authentication as Basic Auth and provide admin username and password,
now hit the send button and you will get the response something like this
Here is the end result of how will image look like on the form.
mark this as helpful if this helped, if you have any queries please do post.
thanks & Regards
Hammad Ul Aziz (Sr. Developer)
- 8,205 Views

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
I Hope this is helpful.

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
s

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
I tried the above approach on catalog item record on icon field, the image is getting attached correctly on the record and shown correctly however the the icon field has broken image. Any solution for the same?

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
@Rasmita can show me what it looks like? Maybe try reducing the image resolution/size!
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
i tried this using postman and it is working fine , but how to do this in service now itself, can u pls help
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi Hammad,
What changes would be necessary to add this as an attachment to the record?
Thank you!