how to call a image in server side script

shaik_irfan
Tera Guru

Hi,

 

I have an image in the Images table which i want to call in Business Rule. Can anyone please help me on this

1 ACCEPTED SOLUTION

You should be able to reference it by doing: instance.service-now.com/imagess.gif

Replace instance with the name of your instance.

View solution in original post

8 REPLIES 8

Brad Tilton
ServiceNow Employee
ServiceNow Employee

You can always query the db_image table to get that record, but what exactly are you looking to do with it in a business rule?

I am actually integrating with Slack where i need to pass an image.

 

All the integration is working fine only challenge is i need pass the image and pass with the url.

 

I just need to get the url of that image then i can pass that in my script.

I believe the image url would just be instance.service-now.com/imagename.ext. The image is stored as an attachment, so to send the image over I think you would want base64 encode it then send that over. Here is some documentation that may help:

https://docs.servicenow.com/bundle/madrid-platform-user-interface/page/administer/navigation-and-ui/...

https://hi.service-now.com/kb_view.do?sysparm_article=KB0547129

https://snprotips.com/blog/2016/2/25/understanding-and-using-glideattachment

Thank you Brad,

 

I already gone through the documents. 

 

By any chance can you please help me with the code where the image can be converted to url ?

 

 

Just like this: https://www.gstatic.com/webp/gallery3/1_webp_ll.png