Configurable Workspace -> Contextual Side Panel: how to access data from associated record?

GV Jan Moser
Giga Guru

Hi,

I created new Tab within Contextual Side Panel:

JanMoser1_0-1668685579811.png

 

Now, I would like to access data from the associated Record so I can work with them. How do I do that in UI Builder? Lets say, I would like to have simple Stylized text component showing current table name of the Record. How do I do it? The way I am trying on screenshot below is not working:

JanMoser1_1-1668685674157.png

 

Thank you.

 

Jan

1 ACCEPTED SOLUTION

JagjeetSingh
Kilo Sage
Kilo Sage

Hi,

 

Here is how you can do it. Each tab in contextual side panel behaves as a new page but the way to assign the parameters is different than normal pages in UI builder.

 

1. Open your contextual side panel tab in UI builder.

2. Click on "Body" component.

3. In Page Configuration panel click on edit besides properties.

JagjeetSingh3_0-1670913836630.png

 

4. Here you can create your properties to hold the data from parent record. For example here I created "recordSysId" to get the parent record sysid.

JagjeetSingh3_1-1670913941139.png

 

5. I can now bind this property to any data source from my parent record. All data sources are accessible here from record page. Here I am using Glide Form data source from Record page to get the sysId of record.

JagjeetSingh3_2-1670914458312.png

 

6. You can now access this sysid via @context.props.recordSysId in your tab.

 

 

 

Jagjeet Singh
ServiceNow Community Rising Star 2022/2023

View solution in original post

3 REPLIES 3

JagjeetSingh
Kilo Sage
Kilo Sage

Hi,

 

Here is how you can do it. Each tab in contextual side panel behaves as a new page but the way to assign the parameters is different than normal pages in UI builder.

 

1. Open your contextual side panel tab in UI builder.

2. Click on "Body" component.

3. In Page Configuration panel click on edit besides properties.

JagjeetSingh3_0-1670913836630.png

 

4. Here you can create your properties to hold the data from parent record. For example here I created "recordSysId" to get the parent record sysid.

JagjeetSingh3_1-1670913941139.png

 

5. I can now bind this property to any data source from my parent record. All data sources are accessible here from record page. Here I am using Glide Form data source from Record page to get the sysId of record.

JagjeetSingh3_2-1670914458312.png

 

6. You can now access this sysid via @context.props.recordSysId in your tab.

 

 

 

Jagjeet Singh
ServiceNow Community Rising Star 2022/2023

Vijayalakshmi P
Kilo Sage

Hello @JagjeetSingh ,

How to refresh a contextual side bar component upon updating the record? Pls share some ideas

 

Thanks,

Vijayalakshmi P

Hello @Vijayalakshmi P ,

well, when we create components or pages, we don't refresh things. We change properties and everything that is bind to those properties refreshes automatically by the engine.

 

If you bind some data resource (for example) in your contextual side panel page to the SysID property of the record and this SysID changes, your data resource refreshes as well 😉

Jan