UI Builder JSON Objects within chrome_toolbar

gwen
Tera Contributor

I'm trying to show/hide icons on the Workspace LHS toolbar based on some conditions (not roles) but cannot find any documentation on what objects are available. I have seen the following "condition" object 

          "condition":{
             "tableDescription":{
                "table":"x_g_jhu_transport_request",
                "canCreate":true
             }
          }

but what else is available to me within this condition?  What if I wanted to display the icon if e.g. the user's department's type is internal (sys_user -> cmn_department -> type), or if the user's business unit head is a Level2 (sys_user -> business_unit -> head of business unit -> rank)? 

Is there a way of querying a table's field value, or calling an external / client script?

2 REPLIES 2

Ravi Gaurav
Giga Sage

Hi @gwen 

 

You’ve stumbled on one of the trickier parts of Workspace Experience / Unified Navigation in ServiceNow:
the JSON-based LHS toolbar config (app-shell, lhs_navigation, etc.) supports conditions, but it’s not very well-documented what you can reference.

Here’s the breakdown:

 

1. What the "condition" object actually supports

  • The condition object is really just a wrapper for the Platform Access Control checks (ACLs, table permissions, CRUD).

  • That’s why in the example you found:

     
    "condition": { "tableDescription": { "table": "x_g_jhu_transport_request", "canCreate": true } }

    it evaluates whether the logged-in user can create records on that table.

  • Other supported flags are:

    • canRead

    • canUpdate

    • canDelete

  • You can combine multiple checks (logical AND) in the same condition.

But these are not dynamic user-field checks (like department type or BU head rank). They’re ACL-like checks.

 

What you cannot do directly

Out of the box, you can’t directly write something like:

 
"condition": { "user.department.type": "internal" }

That’s not supported in the schema.

 

3. How to achieve your “department type” or “business unit head rank” use cases

To handle these, you need to bring in a derived boolean field or a user criterion:

Option A: User Criteria (Recommended)

  • Define a User Criteria record (e.g., "Internal Dept Users").

  • Build conditions using related tables (sys_user.department.type = internal, etc.).

  • Reference the User Criteria in the App Shell / LHS nav item visibility instead of raw condition.

Option B: Scripted Condition / Derived User Field

  • Add a derived field (like u_is_internal_user on sys_user) using a Business Rule/Script Include.

  • Then configure your condition to check a table CRUD permission against a “dummy” table or use a UI Builder visibility condition that references that field.

Option C: UI Builder Rule Evaluation (if using Workspace in UI Builder)

  • In the Experience > LHS Navigation config inside UI Builder, you can add a visibility rule that calls a Data Resource (server-side GlideRecord query).

gwen
Tera Contributor

Thanks for the detailed reply.  I suspected this would be a more complex solution, however I had been hoping  (dreaming probably!) that there might be some documentation.
I do have a further question based on your response.  You have stated 

  • Reference the User Criteria in the App Shell / LHS nav item visibility instead of raw condition.

Can you point me to any documentation on how this is to be done?  Is there a way to access the LHS nav item that is not the chrome_toolbar UX Page Property?  If not, how would I reference this User Criteria in the chrome_toolbar?