How to take custom icons in Service Portal if relevant Glyph is not present ?

Apurv Kumar
Tera Expert

I want to add a custom icon from db_image table into service portal for which i created an instance option "image" and i am able to select the image. All i need is to select the icon if glyph is not selected in the service portal instance and it is selected in the image in the option. Kindly help me with HTML code snippet to add the icon from the image table if glyph is not present.

 

5 REPLIES 5

okay so in that case your src should be dynamic right ?

then in the server script you can glide record to db_image table and get the source and push it to HTML using ng-src attribute 

server script:

var gr = new GlideRecord('db_image');
gr.addQuery('your query');
gr.query();
if(gr.next())
{
data.image = gr.name;
}

HTML:

<div ng-if="data.showImage==true">
<img ng-src={{data.image}}/>
</div>