how to link a UI action to a dashboard?

patricklatella
Mega Sage

hi community, 

is it possible to use a UI Action form button to link the user to a dashboard, and in the same window?

thanks!

1 ACCEPTED SOLUTION

Sure.

Please use below script

gs.setRedirect('/nav_to_do?uri=/$pa_dashboard.do?sysparm_dashboard=00701c67db6c1b803c6873e1ba9619ac');

and

personal preference for the user had to be set to "Dashboards" for their home page preference.

 

find_real_file.png


Please mark this response as correct or helpful if it assisted you with your question.

View solution in original post

26 REPLIES 26

those last 2 both direct to the dashboard, but inside the frame

find_real_file.png

WHat is embedded? Just removed it. Can we try with this. Sorry but I get a different link on address barso not able to reproduce

 

gs.setRedirect('uri=/$pa_dashboard.do?//dashboard=00701c67db6c1b803c6873e1ba9619ac&tab=8eb09c67db6c1b803c6873e1ba9619c2');


Please mark this response as correct or helpful if it assisted you with your question.

thanks Sanjiv, but it again links to the dashboard, but inside the split view frame like last screen shot.

Here's many a clue I'm working on...when I just go to the dashboard in my normal view, the URL in the browser is "https://xxxx.service-now.com/nav_to.do?uri=%2F$pa_dashboard.do"

anything we can pull from here to use?

Thats how it is for me.

 

Then when I open one of the dashboards, the link changes to 

https://xxx.service-now.com/nav_to.do?uri=%2F$pa_dashboard.do%3Fsysparm_dashboard%3D02874c6d3b400300b90c4bb534efc4f1

 

So I wanted to check, if you add this, what happens, assuming your dashboard id is 00701c67db6c1b803c6873e1ba9619ac

 

gs.setRedirect('uri=/$pa_dashboard.do?sysparm_dashboard=00701c67db6c1b803c6873e1ba9619ac');


Please mark this response as correct or helpful if it assisted you with your question.

ok, found something interesting:

your last one:

gs.setRedirect('uri=/$pa_dashboard.do?sysparm_dashboard=00701c67db6c1b803c6873e1ba9619ac'); //opens the correct dashboard, but in the frame as we've seen

 

but this one:

gs.setRedirect('/nav_to_do?uri=/$pa_dashboard.do?sysparm_dashboard=00701c67db6c1b803c6873e1ba9619ac'); //opens correctly to full screen, but opens the wrong dashboard??

odd right?  it's opening properly, but aiming at wrong dashboard, but that second one is opening to the full screen

find_real_file.png