How to get the current PA dashboard name /sys_id in the server/client script

Swathi12
Tera Expert

Hi,

 

I am trying the fetch the current PA dashboard name in my widget script and feed it to one of the custom tables I have created , so that it can be further used for referencing.

 

But I am not able to get the code for getting the dashboard name in my widget.

 

Regards,

Swathi

1 ACCEPTED SOLUTION

Swathi12
Tera Expert

Hi All,

 

I have got the solution , We can get the Dashboard sys id in the client script using SNC.dashboards.dashboard.dashboardSysId and pass it to script include for querying pa_dashboards table for getting the current dashboard name.

 

Do let me know if you have better ideas.

 

Regards,

Swathi

View solution in original post

5 REPLIES 5

Adam Stout
ServiceNow Employee
ServiceNow Employee

We are running a CreatorCon session at K18 on creating Custom Visualizations and Custom Interactive Filters.  Any chance you are planning on attending that?

No Adam, Am not attending it 😞

Adam Stout
ServiceNow Employee
ServiceNow Employee

I can't find any documented (or supported) way to do it.  If you explore the JavaScript variables in your browser console, you may find the sys_id for the dashboard, but there is no guarantee that this would work in future releases.

Swathi12
Tera Expert

Hi All,

 

I have got the solution , We can get the Dashboard sys id in the client script using SNC.dashboards.dashboard.dashboardSysId and pass it to script include for querying pa_dashboards table for getting the current dashboard name.

 

Do let me know if you have better ideas.

 

Regards,

Swathi