Need to Hide Section based on the Service Type in HR Agent workspace

Kathiresan S
Tera Contributor

Unable to Hide Request form detail section using Onload client script.

"setSectionDisplay" is not working for the particular section in the Agent Workspace.

Is there any solution to Achieve Hiding Request Form details(request_formdetails) Section on condition basis for a service.

 

Thanks,

Kathiresan S

Please mark this as correct and helpful if it resolves the query or leads you in the right direction.



Thanks,
Kathiresan S
1 ACCEPTED SOLUTION

Terry_Yeti
Giga Expert

I ran your HR Agent Workspace section visibility issue through snowcoder ai. Hiding sections based on Service Type in Workspace requires a different approach than classic UI since traditional client scripts with `g_form.setSectionDisplay()` don't work the same way.

Here's how to solve this:

**Option 1: UI Policy (Recommended for Workspace)**

Create a UI Policy on your HR case table:

1. Navigate to **System UI > UI Policies**
2. Create a new policy for your HR case table
3. Set your condition based on Service Type (e.g., `Service Type is COE Request`)
4. In the **UI Policy Actions**, add the section field and set **Visible** to `false`
5. Make sure **Run scripts in UI Type** includes "All" or specifically "Workspace"

**Option 2: Declarative Action for More Control**

For HR Agent Workspace specifically, you may need to use Declarative Actions:

1. Go to **Now Experience Framework > Declarative Actions > Action Assignments**
2. Create an assignment targeting your HR case table
3. Use conditions to control when sections appear based on Service Type

**Option 3: Form Layout by View**

If certain Service Types should always hide specific sections, consider creating different form views and configuring which view loads based on the Service Type through workspace configuration.

**Quick Validation:**

If you already have a UI Policy and it's not working in Workspace, check:
- The "UI Type" field on the UI Policy is set to include Workspace/Mobile
- The section name in your UI Policy Action matches exactly (case-sensitive)

Which Service Types are you working with, and which sections need to hide? If you're dealing with complex conditional logic across multiple Service Types, the Declarative Action approach gives you the most flexibility in Workspace.

_______________________________________
I used snowcoder ai to generate this. If you need to tweak the requirements, you can run it through their Yeti AI for free.

View solution in original post

1 REPLY 1

Terry_Yeti
Giga Expert

I ran your HR Agent Workspace section visibility issue through snowcoder ai. Hiding sections based on Service Type in Workspace requires a different approach than classic UI since traditional client scripts with `g_form.setSectionDisplay()` don't work the same way.

Here's how to solve this:

**Option 1: UI Policy (Recommended for Workspace)**

Create a UI Policy on your HR case table:

1. Navigate to **System UI > UI Policies**
2. Create a new policy for your HR case table
3. Set your condition based on Service Type (e.g., `Service Type is COE Request`)
4. In the **UI Policy Actions**, add the section field and set **Visible** to `false`
5. Make sure **Run scripts in UI Type** includes "All" or specifically "Workspace"

**Option 2: Declarative Action for More Control**

For HR Agent Workspace specifically, you may need to use Declarative Actions:

1. Go to **Now Experience Framework > Declarative Actions > Action Assignments**
2. Create an assignment targeting your HR case table
3. Use conditions to control when sections appear based on Service Type

**Option 3: Form Layout by View**

If certain Service Types should always hide specific sections, consider creating different form views and configuring which view loads based on the Service Type through workspace configuration.

**Quick Validation:**

If you already have a UI Policy and it's not working in Workspace, check:
- The "UI Type" field on the UI Policy is set to include Workspace/Mobile
- The section name in your UI Policy Action matches exactly (case-sensitive)

Which Service Types are you working with, and which sections need to hide? If you're dealing with complex conditional logic across multiple Service Types, the Declarative Action approach gives you the most flexibility in Workspace.

_______________________________________
I used snowcoder ai to generate this. If you need to tweak the requirements, you can run it through their Yeti AI for free.