I want to control the display of menu items in the mega menu by conditions.

M_Tomy
Tera Expert

Dear Expert.

 

Please tell me how to control the Mega Menu in the Employee Center.

 

I want to hide menu items in the Employee Center according to conditions.

M_Tomy_0-1739783266959.png

 

 

(1) In which table should I set this up?

 

(2)I would like to use the same user criteria that I use elsewhere if possible. If possible, please let us know the implementation procedure or knowledge that could be used as an implementation sample.

 

Thank you in advance.

 

1 ACCEPTED SOLUTION

Gustav Aldenbra
Kilo Sage

Hi @M_Tomy 

 

Topics in the menu is controlled by users access to content connected to the topic. If you have added menu items that is not a topic you can controll access to the menu items using a condition.

 

You can find you menu items in the releated list of you menu in table sp_instance_menu. In the condtion field you can write a javascript condition, if you want the condtion to be based on user criteria you can use the following as the condition: "sn_uc.UserCriteriaLoader.userMatches(gs.getUserID(),["<sys_id of the user critera>"])"

View solution in original post

6 REPLIES 6

Dan O Connor
ServiceNow Employee
ServiceNow Employee

There is no specific configuration for what you are asking. 

Topics in the Mega Menu are controlled by the User Criteria of the connected content within the topic. If the logged in user can see the content based on User Criteria, they can see the Topic in the Mega Menu.

If the user cannot see the item based on User Criteria, the topic is hidden from them in the Mega Menu. 

All this is driven by User Criteria at the granular level of Catalog Items and Knowledgebase articles. 

sravya chipilla
Tera Contributor

(1) Where to Configure Mega Menu Items?

The Mega Menu in Employee Center is controlled via the sys_ux_navigation_menu_item table.

You can access it by navigating to: Employee Center → Menus → Menu Items
(sys_ux_navigation_menu_item table)

(2) How to Hide Menu Items Using User Criteria?

You can control visibility using User Criteria (user_criteria table), which is commonly used for knowledge base restrictions, catalog items, and now Employee Center.

Steps to Apply User Criteria to Mega Menu Items:

  1. Navigate to Mega Menu Items:

    • Go to Employee Center → Menus → Menu Items.
    • Locate the menu item you want to control.
  2. Edit the Menu Item Record:

    • Open the record for the specific menu item.
    • Look for the "User Criteria" related list (Enable it via Form Layout if not visible).
  3. Apply User Criteria:

    • Click New in the User Criteria related list.
    • Select an existing User Criteria or create a new one.
    • Click Save.
  4. Test Visibility:

    • Log in with different user roles and ensure the menu item hides/shows correctly.

      mark correct if my solution helps

@sravya chipilla 

Thank you for your answer.

 

The procedure you presented is interesting.
However, when I try it, I do not see the “User Criteria” in the relevant table in my instance.
Is it possible for you to show me how to display it with a specific screen capture?

I am very sorry.

 

Thank you very much.

If you don’t see the User Criteria related list in the menu item form, follow these steps:

  1. In the menu item record, click the Context Menu
  2. Select Configure → Related Lists.
  3. In the Available section, search for User Criteria

    still if u cant see that , get a user criteria table into the related list and then try to add it