HR - Variable visibility in the portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-29-2024 03:24 AM
How to hide some variables in the portal to specific users/roles. These variables should be only visible to approvers and to a user whose name was mentioned in the request form. This is for HR Application
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-29-2024 03:43 AM - edited ‎07-29-2024 03:45 AM
Hi @Sravani2
To hide specific variables in the ServiceNow portal based on user roles or names mentioned in the request form, you'll need to use a combination of Access Control Rules (ACLs) and UI policies/scripts.
1) Create ACLs to restrict access to these variables based on roles.
- Navigate to: System Security > Access Control (ACL).
- Click on New to create a new ACL.
- Define the ACL:
- Type: Record
- Operation: Read
- Name: [Table name].[Variable name]
- Condition: Define a condition to check if the user has the required role or is the user mentioned in the request form.
2) You can also use UI policies or Client Scripts to control the visibility of variables on the form.
Option A: UI Policies
- Navigate to: Service Catalog > Catalog UI Policies.
- Click on New to create a new UI policy.
- Configure the UI Policy:
- Table: [Your Table Name]
- Conditions: Define conditions to determine when the policy applies.
- Actions: Define actions to hide or show variables.
- Create UI Policy Actions to hide/show variables:
- Field name: [Variable Name]
- Visible: False (to hide)
- Mandatory: False (if it was mandatory)
Option B: Client Scripts
- Navigate to: Service Catalog > Catalog Client Scripts.
- Click on New to create a new Client Script.
- Configure the Client Script:
- Type: OnLoad
- Script: Use a script to check user roles and hide variables as needed.
i hope my answer helps you to resolve your issue, please mark correct and helpful accordingly.
thank you
Rajesh Chopade.