Retrieving Multiple System IDs in UI Builder for Contextual Sidebar

saurabdev
Tera Contributor

I'm experiencing an issue in UI Builder while working with the contextual sidebar. Here are the details:
1. Overview:
- Added a new tab in the contextual sidebar
- Included a text area in this tab
- Goal: Display both interaction and incident system IDs when creating an incident from agent chat
2. Current Behavior:
- Initially, the URL contains only the interaction table and ID
- Example: `/now/sow/record/interaction/ef4585d4931782505df2f7718bba1016`
- When creating an incident, a new tab opens with both interaction and incident IDs in the URL
- Example: `/now/sow/record/interaction/ef4585d4931782505df2f7718bba1016/sub/record/incident/2b76c3a9931b4a505df2f7718bba1067`
3. Attempted Solution:
- Used a script in the text area value: `api.data.record.sysId` and `api.data.record.table`
- Result: Only retrieves the last part of the URL (incident table and ID)
- Unable to obtain the interaction table and ID
4. Desired Outcome:
- Retrieve and display both the interaction and incident system IDs in the UI Builder text area
5. Questions:
- How can I access both the interaction and incident system IDs in UI Builder?
- Is there a method to parse the full URL and extract both IDs?
- Are there any best practices or recommended approaches for handling multiple record types in the contextual sidebar?
Any assistance or guidance on this matter would be greatly appreciated. Thank you in advance for your help!

1 REPLY 1

Mark Manders
Mega Patron

Sorry that I haven't got the solution, but in the Next Experience community you may get an answer sooner than in the CSDM community. I know that ServiceNow devs are active there as well.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark