- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 08-05-2020 10:33 AM
Issue
After adding a search source Departments, it was locked down for user security purposes and wasn't returning data in the portal search.
User Requirements
In order to see an make these changes you will need to be logged into your ServiceNow instance as a user with the admin role.
A standard instance is enough to walk through this article. I verified using my personal developer instance.
Initial Setup of Department Search Source
You will need to have created a search source for the Department table and added it to the Service Portal as a search source. there is a Now Learning course that helped me to do this: Creating Simple Search Sources in a Service Portal
Create Simple Search Source
- Navigate to Service Portal > Search > Search Sources
- Click the New button
- Enter on form:
-
- Name: Departments
- ID: departments
- Roles: Making available for internal and external users
-
- click pencil
- Move Available roles to Selected for these roles: snc_external, snc_internal
- Click Done button
- On the Data Source tab enter
-
- Table: Choose Department [cmn_department]
- Primary display field: Name
- Display fields (click on the lock button)
- Choose other fields you'd like in the search, example: Description, Phone
- On the Typeahead tab Enter:
-
- Enable typeahead: Checked
- Page: form
- Right-Click gray area next to Search Source Select Save in context menu.
Add Search Source to Service Portal
- After saving the Search Source go to the Portals tab at the bottom of the form.
- Click Edit button
- Move the Service Portal from left list box to right list box.
- Click Save button
Test Search to Show Issue:
- Navigate to Organization > Departments
- Find a name to search for, using Development for testing. Click on Development so you can see what it contains. Has name description and phone number, which is enough for us to test with.
- Now navigate to the Service Portal: https://dev[instand ID].service-now.com/sp
- In the how we can help search enter Development
-
- Some this show in type ahead list, but not our Development department
- Click magnifying glass to return full list.
- In Sources click on Departments
- Result, "Your search - development - did not match any documents ...
- Expected result: Development department is displayed in list.
Solution
After several days of research, development and testing I finally found the solutions. Special note, the Customer Success Center had the most relevant content and really helped me in my research. I've put together this article as I'm hoping it will help others solve this issue faster than several days.
Setup Table Security
Started by adding security for the table Departments following exercise on developer learning: Securing Table Records
- Login as user with admin role
- Navigate to System Definition > Tables
- Name search cmn_department
- Select Department
- From user profile menu choose Elevate Roles
- Select security_admin and click OK
-
- NOTE: you may need to switch to the Global application in order to edit.
- Choose the Controls tab
-
- Click checkbox Create access controls, new user role is created
- Right-click gray area at top next to Table.
- Choose Save from context menu.
- Navigate to System Security > User Groups > Roles
- Do this for each role that needs access, example gives access to snc_internal & snc_external
-
- Search for role
- Click on role to edit
- On Contains Roles tab Click Edit... button
- Move u_department_user role to Contains roles list.
- Click Save button.
Configure Departments Table for Text Search
This was the final solution to the issue, the table needed to be setup for a full text index search. I followed the instructions found here to do these steps: Configure a single table for indexing and searching
- Navigate to System Definition > Text Index Configurations
- Click New button
- Choose these items:
-
- Table: Department [cmn_department]
- Format: v4
- Right-click in gray area next to Text Index Configurations and choose Save from context menu
- Click Generate Text Index under Related Links
- Enter your email and click OK
-
- Because it's a PDI it may not send you the email.
- Give it a few minutes.
- Ready to go through test again. Be sure to logout and back in to get new roles.
- RESULTS: Development department is displayed in list.
- Also, impersonate users with the roles we selected for read only and verify that they have read only access.
- 1,595 Views