Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Rich Content Widget – How to Add Script or Dynamic Data?

jing_a_zeng
Tera Contributor

Hi Community,

I’m trying to use the Rich Content widget in Employee Center Pro to show building info based on the current user. I want to:

  • Get the user's building ID from the User table
  • Use it to pull details from the Building table (address, features, etc.)
  • Display this info dynamically in the widget

Is there a way to add scripts or dynamic variables in the Rich Content Editor to achieve this?

Thanks!

4 REPLIES 4

Rafael Batistot
Kilo Patron

Hi @jing_a_zeng 

This article might help you


https://www.servicenow.com/community/employee-center-articles/dynamic-topic-microsites-amp-rich-cont...

 



If you found this response helpful, please mark it as Helpful. If it fully answered your question, consider marking it as Correct. Doing so helps other users find accurate and useful information more easily.

Hi Rafael,
Thanks for the link! It’s helpful for understanding dynamic microsites, but I didn’t see where we can add scripts or dynamic variables to query tables like User or Building.
I’m trying to show building info based on the current user—any idea how to inject that kind of dynamic data into the Rich Content widget?
Appreciate any tips!
Best,
Jing

jing_a_zeng
Tera Contributor

Hi Rafael,
Thanks for sharing the link! I went through it, and while it gives a good overview of dynamic topic microsites and Rich Content usage, I didn’t see specific guidance on how to add scripts or dynamic variables to query tables like User or Building directly within the Rich Content widget.
My goal is to display building details dynamically based on the current user's building ID. Ideally, I’d like to:

Retrieve the building ID from the User table
Use that to query the Building table for address and features
Inject that info into the Rich Content widget dynamically

Do you know if there’s a supported way to embed scripting in the Rich Content Editor, approach for this kind of dynamic data binding?
Appreciate any pointers!
Best,
Jing

jing_a_zeng
Tera Contributor

Hi Rafael,
Thanks for the link! It’s helpful for understanding dynamic microsites, but I didn’t see where we can add scripts or dynamic variables to query tables like User or Building.
Appreciate any tips!
Best,