REST API to get the Views for a module

sahilkhanna
Tera Expert

Is there a REST API to get the views for a module? In my instance, I can see the following views.

 

For sn_customerservice_case, below are the views available

  • Add_Child_To_Case
  • Case
  • Connect
  • Consumer Self Service
  • CSM Workspace
  • Customer Self Service
  • Customer Self Service Admin

 

For customer_contact, below are the views available

  • Case
  • Customer Self Service
  • Self Service
  • Service Portal
  • Workspace

                                                                                                                                                                 

 

Apart from this, I also want to know

  • Can these views be visible to all the non-admin users, or can roles be restricted to certain users or roles?
  • If they can be restricted to certain users/roles, is there any API to get the roles available/visible to a user?
2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

@sahilkhanna 

this table holds the information about table and views -> sys_ui_form

See if you can consume that table using table API

AnkurBawiskar_0-1738771337393.png

Views are enforced using view rules.

all views are visible for non-admins in the context menu, those will always be seen here.

AnkurBawiskar_1-1738771435068.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

 

@Ankur Bawiskar , I looked at the table and searched for "customer_contact" and "sn_customerservice_case". I can see a total of 5 views.

Screenshot 2025-02-19 at 20.00.05.png

 

However, in the SN portal, Case itself has 14 views. Why the difference?

Screenshot 2025-02-19 at 23.33.00.png