Some PDIs are currently unavailable, and PDI actions are paused. View the latest updates here. Read More

UI Builder Workspace – Unable to Configure "Back to Story" Navigation When Task Opens as Sub Record

HimanshuS876326
Tera Contributor

Hi Everyone,

I'm building a custom Project Management Workspace using ServiceNow UI Builder and I'm facing an issue with record navigation.

I have three custom tables:

  • Project
  • Story
  • Task

A Story references a Project, and a Task references a Story through a reference field (u_reference_1).

I have created three separate record pages in UI Builder:

  • Project Record Page
  • Story Record Page
  • Task Record Page

The Story Record page contains the standard OOTB Record Related List Repeater that displays the related Tasks.

Problem

When I click a Task from the Story related list, I expect it to open my dedicated Task Record page. Instead, it always opens as a workspace sub-record under the Project Record page.

The URL is similar to:

.../project-record/.../sub/record/<task_table>/<task_sys_id>

Because of this, my custom Task Record page is never used.

Requirement

I need to add a "Back to Story" button while viewing a Task so that users can easily navigate back to its parent Story.

Current Situation

  • A "Back to Project" button already works correctly from the Story page.
  • If I place the "Back to Story" button on the Task Record page, it never appears because that page is never opened.
  • If I place the button on the Story Record page, it is visible while viewing a Task (since the Task is rendered as a sub-record), but I cannot access the current Task record or its Story reference field to configure the navigation.

What I've Already Tried

  • Used visibility scripts based on the current table (works correctly).
  • Configured an Open Page event, but only Story fields are available for binding; Task fields are not exposed.
  • Created a UI Builder Client Script and checked api.data, api.context, api.context.props, and event.payload, but none of them contain the current Task record.
  • Checked the Form Controller, which only exposes the current table and sys_id.
  • Created a dedicated Task Record page and added a Heading component to verify navigation. The heading never appeared, confirming that the Task Record page is never used.
  • Checked the Record Related List Repeater configuration but couldn't find any option to override the navigation behavior.

My Questions

  1. Why does the standard Record Related List Repeater always open the built-in sub-record page instead of my dedicated Task Record page?
  2. Is it possible to configure the Related List to open a custom record page instead?
  3. Is there any supported way to override the sub-record routing in a Workspace?
  4. While viewing a Task as a sub-record, is there a supported way to access the current Task record (or its parent Story reference) from a UI Builder button or client script?
  5. Has anyone implemented a Back to Parent Record button in this scenario? If so, what approach did you use?

Any guidance or best practices would be greatly appreciated. This is the final navigation requirement remaining in my workspace, and I've been unable to find a supported approach.

Thank you!

3 REPLIES 3

Vikram Reddy
Tera Guru

Hi @HimanshuS876326,

 

Short verdict: this is a component limitation, not a platform bug, and it's fixable without a client script trying to reach into the sub record. Taking your five questions in order.

  1. Why the Repeater always opens sub record: the OOTB Record Related List Repeater's row click is hardcoded to the workspace's built in "open as sub record" behavior. It never does a route lookup against your custom Task Record page, it just fires the generic record/.../sub/record/... navigation. That's exactly why you found no override property, there isn't one.
  2. Can the Related List target a custom page: not the Repeater itself, no. But a plain List component (or Data Table) on the same Story page, pointed at a List data resource for Task, gives you a real Row clicked event instead of baked in behavior.
  3. Supported way to override sub record routing: swap components rather than fight the Repeater. On the List component's Row clicked event, choose Navigate to Page, target your Task Record page, and bind sys_id from the event payload, for example @payload.sys_id, using the data pill picker rather than typing it.
  4. Reading the current Task record while it's a sub record: not supported, and you already proved it, api.context, api.context.props, event.payload and the Form Controller on the Story page only ever expose Story. A sub record renders in its own isolated routed context that the parent page's client scripts can't reach. Stop chasing that path.
  5. Back to Parent pattern: once Task loads through the List component instead of the Repeater, it's a genuine top level page with its own Form Controller and data resource, so u_reference_1 is available just like Project is on the Story page. Wire Back to Story with the same Open Page action plus reference field binding you already have working for Back to Project, no new script needed.

If the List component's row click event doesn't show Task's data resource as an option, that usually means the data resource isn't scoped correctly, paste the resource config and I'll take a look.

 

Thank you,
Vikram Karety
Octigo Solutions INC

Thank you very much for your guidance. I followed your recommendation and tried multiple approaches, but I'm still unable to get it working in my Zurich instance.

I replaced the OOTB Record Related List Repeater and also tried using the available Record List component bundle, but it doesn't behave as expected. I don't see a standalone List or Data Table component in my component picker, so I'm not sure if I'm using the correct component.

Could you please let me know exactly which UI Builder component you were referring to? If possible, a screenshot of the component or its configuration would be extremely helpful.

This is the last remaining task in my Project Management Workspace, and I've been stuck on it for quite some time.

If you're available and willing, would it be possible to have a short 10–15 minute Teams or Google Meet call? I completely understand if that's not convenient, but I would really appreciate your guidance. Thank you again for your time and help.

HimanshuS876326
Tera Contributor

Hello @Vikram Reddy,

 

I'm waiting for the response.

 

Thanks