Hide Tab not working when Playbook component uses Parent Record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi everyone,
I’m facing an issue with the Record Playbook component in UI Builder and would appreciate any suggestions.
Scenario:
My Record Page is built on the Task table.
Initially, the Playbook was associated directly with the Task, and the Hide Tab condition worked correctly. The Playbook tab was shown only when a playbook was available for the task.
We have now changed the Playbook to be associated with the Parent Case ( Case) instead of the task.
What I changed:
The Record Playbook component is configured with:
Parent Table =l Case
Parent Sys ID = record.form.fields.parent_case.value
I created a data resource (record_has_playbook) that checks whether the parent case has a playbook.
The data resource returns the correct output (true/false).
Issue:
If I bind the Playbook component visibility to the data resource, it behaves correctly.
However, when I use the same data resource for Tab Settings → Hide Tab, the tab never becomes visible.
UI Builder - Hide Tab not working when Playbook component uses Parent Record
Settings → Hide Tab, the tab never becomes visible.
TIA
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hey @Yathvika,
Switch off the client-side data resource for the Hide Tab option under Tab Settings and use a server-side UX Screen Condition instead, that's how ServiceNow's own Record Playbook tab pattern is documented. Component Visible bindings re-evaluate reactively once the data resource resolves, but Hide Tab gets evaluated earlier in the tab-render cycle, before a chained data resource depending on record.form.fields.parent_case.value has actually populated, so it just stays hidden. Add a condition under UX Screen Conditions on the app route that resolves the parent Case record server-side and calls sn_playbook.PlaybookExperience.parentRecordContainsPlaybook() against it, that's the supported approach for parent-linked playbooks.
Thank you,
Vikram Karety
Octigo Solutions INC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Yathvika ,
This behavior is expected. The Hide Tab setting is evaluated much earlier in the page lifecycle than the component visibility. When the tab is being rendered, the client-side data resource that depends on record.form.fields.parent_case.value may not have resolved yet, so the tab remains hidden.
Instead of using a client-side data resource for Hide Tab, use a server-side UX Screen Condition. In the screen condition, resolve the parent Case record and use sn_playbook.PlaybookExperience.parentRecordContainsPlaybook() to determine whether a playbook exists. This is the same approach used by the out-of-the-box Record Playbook implementation and ensures the tab visibility is evaluated correctly before the page is rendered.
The Playbook component itself can still use the parent table and parent sys_id configuration, while the server-side UX Screen Condition controls whether the Playbook tab is displayed.
Kind regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello @ajmalmuhamm @Vikram Reddy - Is there any reference available or docs to check how I can use the screen conditions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
When I attempted adding the script in UX screen condition record then it was showing an error (Scripted Conditions are supported only for view ports and not for top level screen variants) and which is not saving the record