I want to display an image( stored in System UI) on Form Layout.So through what method i can accomplish this?

r_21
Mega Contributor

Hi guys,

I want to display an image that i have stored in SN database i.e., System UI > images.So help me out to use that image in my form layout.

1 ACCEPTED SOLUTION

Deepak Negi
Mega Sage
Mega Sage

You would need to create a UI macro and formatter for the table.
Suppose you need to display an image on incident form.



Creating a Formatter - ServiceNow Wiki



1. Create a new UI macro 'Example' and put some html there to keep the image in it. somewhat like <img src = 'abc.png'/>


2. Go To Formatters and create a new Formatter
        Name - Incident Image         Formatter - Example.xml


        Table - Incident


3. Go to formlayout for Incident form and drag the "Incident Image" from avaiilable to selected bucket.



I hope it clears.




Thanks


Deepak


View solution in original post

6 REPLIES 6

ahaz86
Mega Guru

You could add a macro field and then create a macro with the following code:



<?xml version="1.0" encoding="utf-8" ?>


<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">


  <img src="YOUR_IMAGE.JPG" height="100px" width="100px"/>


</j:jelly>



Just replace the image source and height/width


Deepak Negi
Mega Sage
Mega Sage

You would need to create a UI macro and formatter for the table.
Suppose you need to display an image on incident form.



Creating a Formatter - ServiceNow Wiki



1. Create a new UI macro 'Example' and put some html there to keep the image in it. somewhat like <img src = 'abc.png'/>


2. Go To Formatters and create a new Formatter
        Name - Incident Image         Formatter - Example.xml


        Table - Incident


3. Go to formlayout for Incident form and drag the "Incident Image" from avaiilable to selected bucket.



I hope it clears.




Thanks


Deepak


r_21
Mega Contributor

Thanks Deepak and Alexander


r_21
Mega Contributor

Hi Deepak,



Is there anyway to make a formatter visible on list view?


Can we create a field dependency for a formatter ?