- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2025 09:07 AM
When creating an HR case, how can I show and hide fields based on something other than the HR Service? The Case Creation Configuration only allows me to change what fields are displayed based on what HR Service is selected. I need to show/hide fields based on other criteria, like whether the case's source(contact_type) is Phone or In-person, or whether the logged-in user is a member of a specific group. Any ideas?
Solved! Go to Solution.
- Labels:
-
Human Resources Service Delivery
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-02-2025 02:12 AM
There isn’t a built-in, out-of-the-box way to conditionally display fields during HR case creation without applying some level of customization.
While the "Case Creation Service Configuration" allows you to control which fields appear based on the selected HR Service, any deeper customization—such as dynamically altering the layout or behavior of the case creation page—requires direct changes to the "case_creation" UI Page. If you choose to go this route, follow these steps:
- Locate the UI Page: Go to System UI > Pages and find case_creation.
- Clone Before Editing: Always create a clone of the original page to preserve the default configuration.
- Modify Client Scripts: Adjust the client-side logic to manage field visibility, validation, or dynamic behavior.
- Edit HTML Layout: Customize the form layout, add or remove fields, and tailor the visual presentation as needed.
However, this approach involves significant customization and maintenance overhead, and is generally not recommended unless absolutely necessary.
Instead of customizing the UI Page, allow the case to be created using the standard case_creation page, and then use UI Policies on the HR Case form to dynamically show or hide fields based on specific conditions (e.g., HR Service, case type, or user role).
This method is more maintainable, upgrade-safe, and aligns with ServiceNow best practices.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-25-2025 08:15 PM
Hello @Lyndsay Greer,
- Navigate to the table that contains the HR case creation form (usually
sn_hr_core
). - Go to the "UI Policies" module and create a new UI policy.
- Set the "Table" to the HR case table and give the policy a descriptive name.
- In the "Conditions" section, define the condition based on the trigger field. For example, if you want to make a field visible when a certain "Case Type" is selected, set the condition to "Case Type equals [Specific Case Type]".
- In the "Actions" section, select the "Actions" to perform when the condition is met. Choose "Field" and specify the field you want to make visible or invisible.
- Set the "State" to "Visible" or "Hidden" based on your requirement.
- Click "Submit" to save the UI policy.
- Create a few test cases on the HR case creation form, ensuring the trigger field is set to different values.
- Verify that the visibility of the targeted fields changes according to the UI policy you defined.
- Trigger Field: Case Type
- UI Policy Configuration:
- Condition: Case Type equals "Compensation"
- Action: Set field "Salary Adjustment" to "Visible"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-28-2025 06:36 AM
Thank you for the reply! I did try a UI policy but it isn't working. I tried in both a subprod instance, and also in my PDI, and the u_test_field still shows on the case creation screen. What am I missing?
Here is the UI policy:
And here is my Case Creation Configuration:
But here is the case creation screen, and Test Field is still visible, no matter which HR Service I select:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-02-2025 02:12 AM
There isn’t a built-in, out-of-the-box way to conditionally display fields during HR case creation without applying some level of customization.
While the "Case Creation Service Configuration" allows you to control which fields appear based on the selected HR Service, any deeper customization—such as dynamically altering the layout or behavior of the case creation page—requires direct changes to the "case_creation" UI Page. If you choose to go this route, follow these steps:
- Locate the UI Page: Go to System UI > Pages and find case_creation.
- Clone Before Editing: Always create a clone of the original page to preserve the default configuration.
- Modify Client Scripts: Adjust the client-side logic to manage field visibility, validation, or dynamic behavior.
- Edit HTML Layout: Customize the form layout, add or remove fields, and tailor the visual presentation as needed.
However, this approach involves significant customization and maintenance overhead, and is generally not recommended unless absolutely necessary.
Instead of customizing the UI Page, allow the case to be created using the standard case_creation page, and then use UI Policies on the HR Case form to dynamically show or hide fields based on specific conditions (e.g., HR Service, case type, or user role).
This method is more maintainable, upgrade-safe, and aligns with ServiceNow best practices.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-02-2025 03:44 AM
Thank you! We definitely don't want to customize the "case_creation" UI Page.