Prince Arora
Tera Sage
Options
- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 12-17-2023 07:31 AM
Often, we encounter requirements that go beyond the capabilities of out-of-the-box (OOB) functionalities. These needs include:
- Incorporating images or logos, like those of a company, into form layouts.
- Crafting customized information or error messages, encompassing hyperlinks, colored text, and more.
- Developing data types not found in the standard library of ServiceNow.
UI macro (Native view only):
UI macro is the hidden gem from which we can create custom user controls and interfaces. UI macros can be used to build solutions that can’t be built using the available data types. Below are the few examples:
How:
1) Add Images/Logos to the form:
a) Upload the image (System UI -> Images) like below:
b) Create a UI Macro (System UI -> UI Macros -> New) and add code there:
<img src="ServiceNow_logo.png" width="200px" height="200px" style="margin-left:40px"/>
c) Create a formatter (System UI -> Formatters) and call the above macro from the formatter
d) Add the Formatter in the form layout from the form designer
Result1:
2) Similarly, we can incorporate customized information or error messages that may encompass coloured text, hyperlinks, and more. Here's an example:
UI Macro: (Note: rest of the process will be as is)
<div class="alert alert-info" style="padding: 5px 16px; position: relative; margin-left: 220px ; margin-right:150px">
If the incident originates from a normal user, assign it a priority of P3.<br></br>
<span style="color:green"> If the incident is reported by a VIP user, set its priority to P2.</span><br></br>
<span style="color:red">If the incident is related to a critical issue, elevate its priority to P1. for more info, please check </span> <a href="https://www.servicenow.com/community/itsm-blog/managing-incident-priority/ba-p/2294101#:~:text=Incident%20priority%20in%20ServiceNow%3A,brand)%20caused%20by%20the%20incident">here</a></div>
Result2:
Likewise, numerous scenarios can be addressed through the creation of custom HTML or the development of customized input fields in ServiceNow.
Happy Reading 😊
Please hit 👍 button, if you find this helpful!!
Labels:
- 445 Views