IT CanvassTalk to an advisor
Development ยท LessonBy , ServiceNow Architect ยท Updated

UI pages, macros & Jelly

The classic templating layer behind custom pages, formatters and legacy UI.

Quick answer

UI pages, UI macros and Jelly are ServiceNow's original server-side templating tools. Jelly is an XML syntax that mixes markup with logic and evaluates on the server to produce HTML. You still meet it in formatters, custom modals, and older customisations, so a working knowledge is essential even in a low-code era.

Key takeaways
  • The pieces
  • Two evaluation phases
  • When you still need it
  • Try it Yourself

UI pages, UI macros and Jelly are ServiceNow's original server-side templating tools. Jelly is an XML syntax that mixes markup with logic and evaluates on the server to produce HTML. You still meet it in formatters, custom modals, and older customisations, so a working knowledge is essential even in a low-code era.

The pieces

  • UI page, a standalone page (HTML, a client script, and processing script).
  • UI macro, a reusable Jelly snippet embedded in forms, lists and pages.
  • Jelly, the <j:jelly> XML that runs the logic.

Two evaluation phases

<?xml version="1.0"?> <j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide"> <!-- Phase 1: server, use $[ ] --> <g:evaluate var="jvar_count"> var gr = new GlideAggregate('incident'); gr.addAggregate('COUNT'); gr.query(); gr.next(); gr.getAggregate('COUNT'); </g:evaluate> <div>Open incidents: ${jvar_count}</div> </j:jelly>
Phase 1 vs Phase 2. Jelly evaluates in two passes: $[ ] (phase 1, first) then ${ } (phase 2). Mixing them up is the number-one Jelly bug. When you can, prefer a modern widget or UI Builder instead of new Jelly.

When you still need it

Custom form formatters, some email layouts, and extending legacy UI16 pages still rely on UI macros. Learn to read Jelly; write new UI on the modern stack.

Practise this on your own free instance.
Set up your free instance →

Practice challenge

3 questions
Q1Jelly is...

A server-side XML templating syntax

Jelly is XML that evaluates on the server to produce HTML.

Q2Jelly's two phases use which tokens?

$[ ] then ${ }

Phase 1 is $[ ], phase 2 is ${ }.

Q3For new UI you should generally prefer...

Widgets / UI Builder

Modern UI is built with widgets and UI Builder.

Frequently asked questions

What does the term UI pages, macros & Jelly refer to in ServiceNow?
UI pages, UI macros and Jelly are ServiceNow's original server-side templating tools. Jelly is an XML syntax that mixes markup with logic and evaluates on the server to produce HTML.
What is the practical takeaway on UI pages, macros & Jelly?
Custom form formatters, some email layouts, and extending legacy UI16 pages still rely on UI macros.
What is worth remembering about UI pages, macros & Jelly in practice?
UI page, a standalone page (HTML, a client script, and processing script). UI macro, a reusable Jelly snippet embedded in forms, lists and pages. Jelly, the <j:jelly> XML that runs the logic.

Want this taught live, with job support?

ServiceNow Training is delivered live by working practitioners, with certification prep and placement support.

See ServiceNow Training โ†’