Dynamic Data Binding in ServiceNow UI Builder: Greet Users Dynamically
Hardcoding text like “Hello user” on a UI might be quick, but it’s not helpful — especially in ServiceNow, where context matters and experiences should feel personal. In this tutorial-style article, we’ll turn a static greeting into a dynamic, user-aware message in UI Builder. You’ll learn three clean ways to bind session data to a Styled Text component so your portal or workspace greets each person by name, without resorting to heavy scripting.
What We’re Building
We’ll start from a simple page layout created in a previous session, then:
Method 1: Directly Bind to Session Properties (No Code)
The fastest, cleanest approach is to bind the component to the current session’s user properties.
You’ll immediately get something like “System Administrator” if you’re logged in as that user. This proves the binding works, but it’s not a “greeting” yet — it’s just the name.
Method 2: Use a Script Expression for Concatenation (Low Code)
If you want “Hello ” and prefer a single expression:
Click Apply to see “Hello System Administrator.” This is quick and flexible, but we can avoid code entirely with the next option.
Method 3: No-Code Formula with string.concat
UI Builder’s Formula binding lets you compose strings without writing script.
Apply to see “Hello admin” or “Hello John Doe,” depending on the property you select.
This approach keeps the experience fully no-code and is great for simple, readable concatenations.
Testing Your Greeting
Practical Tips and Gotchas
Conclusion
You don’t need to hardcode greetings — or write heavy scripts — to personalize UI Builder pages. With a few clicks, you can bind session data directly, use a tiny script for quick concatenation, or stay fully no-code with a string formula.