- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2020 02:19 PM
Hi,
I am developing a custom context menu component for the agent workspace.
How do I pass the current case sys_id to my now ui framework component?
I have read the developer documentation a million times but I just cannot find out how this is done.
Please if anyone knows this I would be incredibly grateful to know.
Solved! Go to Solution.
- Labels:
-
Now Experience UI Framework

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2020 08:35 PM
Components have a number of automatically passed attributes/properties. You can see them by going to "Workspace Experience -> Contextual Side Panel" then just pick any record and scroll down to the related list "Action Model Fields". You should see a list of 10.
You can then just do this in your component code and I believe case matters so if it does not work at first check the case of the property.
properties: {
sysId: {
default: null
},
table: {
default: null
}
}
I have also found that you can detect if your component is being used on a form vers a home page by just checking if gForm was passed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2020 05:12 PM
so far the best solution I have found is to use document.URL to get url and derive the sys_id from that, but it feels like it's not how it should be done....
I am able to pass properties to the component, but only through component attributes which I am not able to pass sys_id for the current case that is open..

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2020 08:35 PM
Components have a number of automatically passed attributes/properties. You can see them by going to "Workspace Experience -> Contextual Side Panel" then just pick any record and scroll down to the related list "Action Model Fields". You should see a list of 10.
You can then just do this in your component code and I believe case matters so if it does not work at first check the case of the property.
properties: {
sysId: {
default: null
},
table: {
default: null
}
}
I have also found that you can detect if your component is being used on a form vers a home page by just checking if gForm was passed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-10-2020 04:43 AM
you are a god! thank you so much.
this worked perfectly.
This information should honestly be made very clear in the developer information, as it's quite critical to be able to get information from the environment.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2020 08:23 AM
Well I cannot take all of the credit for this. I found it and before I had a chance to play with it I had a meeting with one of ServiceNow's UI Framework dev people and asked a bunch of questions and this was the first one.
I agree that the documentation as usual is missing many things as usual.
Some times its not what you know its who you know.... 🙂