Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to read data from SOW record in contextual sidepanel custom component

notlarry
Tera Contributor

Hi, I'm building a custom component using next experience UI framework, and I want to add this component as one of the tabs on the contextual sidepanel that appears inside Service Operations Workspace when looking at an incident (Record SNC page). I want the component to read the information on the incident record that's being displayed, but now sure how to access that data inside my component code.  

 

SOW incident record.png

 

Right now I have a simple hello world component deployed to my personal developer instance that i successfully added through UI builder, but would like for it to reflect the information on the record. I was looking into action handlers but wasn't sure if that was the right way to proceed - ideally i'd like some api call or action handler inside my index.js that can read the current record. Does anyone know how I can do this inside my component code (not through UI builder)?

3 REPLIES 3

Kevin83
ServiceNow Employee
ServiceNow Employee

I believe you are trying to add a tab to the "SOW - Sidebar tabs top" Page collection? 

Screenshot 2024-10-14 at 12.22.40 PM.png

 

If so you can navigate from this panel to the Page Collection overview here and you will see a page like this:

Screenshot 2024-10-14 at 12.25.19 PM.png


Here you can add a new tab, this new tab will have full access to the form controller from the parent record page.

Screenshot 2024-10-14 at 12.32.55 PM.png
You can pass data from output props on the form controller into your input props on your custom component.

Screenshot 2024-10-14 at 12.33.27 PM.png

 

Thanks for the reply! To clarify, I'm trying to add this as a tab to "Contextual Sidebar"

stevesmith0_0-1728941176538.png

I tried to follow your steps - i clicked "Edit content", added a sub-page (which I believe is essentially a new tab), and tried to pass data in. However, when I try to create a property and bind data to it, I'm seeing nothing inside the "Data resource" tab:

stevesmith0_1-1728941259176.png

Is there something else I need to configure to access the data resource?

 

notlarry
Tera Contributor

Thanks for the reply! Just to clarify, I'm trying to edit the "Contextual sidebar" component in SOW:

notlarry_2-1728941702807.png

 

 

I tried to follow your steps - I clicked "Edit content" and added a sub-page (which I thought would act like a new tab, but maybe doesn't). But inside this new tab, when I try to add a property and bind data, I see nothing inside the "Data resource" tab. Is there something I need to do/configure in addition to access the data resource?

notlarry_1-1728941639698.png