- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2025 04:48 PM
Hi @VamsiK144833510
I believe we don't have such OOTB attribute or functionality available for URL field type to render or display images from url. However we have some workarounds.
Solution 1: The HTML field type is designed to render tags. However, it usually shows a toolbar (bold, italic, etc.). We can make this to be "Read Only" so it just looks like an image.
Change your country_flag field type from String to HTML.
Create an onChange Client Script (or a Business Rule) that formats the URL into an image tag.
The Logic: When the REST API returns the URL, don't just save https://..., save:
<img src="https://api.host.com/flag.png" width="50" height="30" />ServiceNow will render this HTML directly on the form.
Solution 2:
If you want the image to look like a native part of the interface without a field box around it, you can use a UI Macro (Global) or UI Page (Scoped).
Create a UI Macro (e.g., show_country_flag_image):
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g2:evaluate var="jvar_my_var" expression="var val = current.getValue('country_flag'); val;" />
<img src="$[jvar_my_var]" style="height: 40px; width: auto; border: 1px solid #ddd; padding: 2px;" />
</j:jelly>
2 . Create a UI Formatter (e.g: Render image)
3. Add a Formatter to the form
Output : you can see the image on form from url as shown below
If this helped to answer your query, please mark it helpful & accept the solution.
Thanks!
Krishnamohan