Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

Default Dashboard in Service Operations Workspace

Nicolas17
Tera Expert

Hello community!

Our Service Desk Manager built himself a custom dashboard in Service Operations Workspace (SOW) and would love to land on it by default when clicking the "Dashboard" button in the left ribbon.

 

Right now, every time he logs back in and goes to that section, it opens the default IT Agent Dashboard instead.

I tried setting the Default Dashboard value in the Service Operations Workspace Experience in UI Builder (see screenshot), but it doesn't seem to have any effect.

 

So my questions are:

  • Is there a way to change the default dashboard for all users (or ideally per user)?

  • Or even better: is there a way to load the last opened dashboard, like what we see in Next Experience UI?

 

Any tips would be really appreciated!

Thanks in advance!

14 REPLIES 14

VanceM
Tera Contributor

Good afternoon!

I believe if you clear the attribute 'Default Dashboard' under 'Dashboard 1' within the 'IT Agent Dashboard' variant on the Service Operations Workspace experience, it will display the user's last visited dashboard.

VanceM_0-1765573169407.png

 

VanceM
Tera Contributor

Apologies, my image didn't come through. Here:

VanceM_1-1765573668476.png

 

Chaddie
Tera Contributor

I just got this working now. 

 

So a new Dashboard was created in Platform Analytics that we wanted to use as the Default, going to call it "My Service Desk" for the purpose of these instructions.

 

Update Default Dashboard when the Dashboard icon is clicked

1. Create update set in Application "Incident Management for Service Operations Workspace"

2. Open UI Builder and search for "Service Operations Workspace" and open it

3. Perform a CTRL+F for "IT Agent Dashboard"

and you'll see a single page within called "Default".

4. Look the right of "Default" row and click on "Settings" and then make this inactive by unticking the Active flag and saving. We'll be creating a variant to replace it.

5.  Next, click on "Duplicate"  (if you can't find that word just CTRL+F and find that word)

6. Give you new variant a name then open it up in the "Editor" 

7. In the Editor, you'll see in the bottom left-hand side "Data and scripts"

8.  Within "Data and scripts" you'll see Data resources -> Dashboard controller

9.  Click on Dashboard controller and then update the dashboardSysId property with the Sys Id of your new Dashboard (e.g. Sys Id of dashboard My Service Desk).

10. Close the window and make sure that change is Saved on your variant by hitting Save button in the top-right

 

Update Landing Page Default Dashboard

1. Create update set in Application "Service Operations Workspace ITSM Common"

2. Open UI Builder and search for "Service Operations Workspace" and open it

3.  Under "Home" Landing Page group look the right of "Service desk landing page PAR SNC" row and click on "Settings" and then make this inactive by unticking the Active flag and saving. We'll be creating a variant to replace it.

4.  As done above, duplicate this page to create a variant

5. Open the variant in the Editor

6. In the left-hand side look for "Dashboard 1" and click on it

7. In the far right ensure you're on "Configure" for this component and then set the "Default Dashboard" to be the name of your default dashboard e.g. My Service Desk

8. In the Editor, you'll see in the bottom left-hand side "Data and scripts"

9.  Within "Data and scripts" you'll see Data resources -> Dashboard controller 1

10.  Click on Dashboard controller 1 and then update the dashboardSysId property with the Sys Id of your new Dashboard (e.g. Sys Id of dashboard My Service Desk).

11. Close the window and make sure that change is Saved on your variant by hitting Save button in the top-right

 

That's all folks 🙂

 

 

 

 

 

i acutally put in a HI case for this that day you added this comment, as i couldnt figure this part out. TY very much for this.

Al-JhonV
Kilo Sage

So I was able to force to display the recent dashboard viewed by the user with the instructions that @Patrick85 provided but I have updated the steps below.

1. Duplicate the Variant
2. Create a transform script from the UI Builder:

AlJhonV_0-1788851470040.png


paste the script:

function transform(input) {
	var dashboardId = '';

	// Get user's last dashboard preference
	var gr = new GlideRecord('sys_user_preference');
	gr.addQuery('user', gs.getUserID());
	gr.addQuery('name', 'com.snc.par.dashboards.ui.preferences');
	gr.orderByDesc('sys_updated_on');
	gr.setLimit(1);
	gr.query();

	if (gr.next()) {
		try {
			var raw = gr.getValue('value') || '{}';
			var parsed = JSON.parse(raw);

			if (parsed.recent) {
				var recentArr = JSON.parse(parsed.recent);
				if (recentArr[0] && recentArr[0].sys_id) {
					dashboardId = recentArr[0].sys_id;
				}
			}
		} catch (e) {
			gs.warn('lastDashboardPref parse error: ' + e);
		}
	}

	// Fallback to default if none
	if (!dashboardId) {
		dashboardId = 'default_dashboard_sys_id'; // The sys_id for the dashboard that you would like to be default
	}

	// Object with a "value" field for UIB
	return {"value": dashboardId.toString()};
}

 
on the Properties field put below code:

[{
"name": "value",
"label": "Value",
"description": "value",
"readOnly": false,
"fieldType": "json"
}]

AlJhonV_1-1788851545707.png

3. create the ACL
4. Update the value of the dashboardSysid on Dashboard Controller 1 to the data resource that you created

AlJhonV_2-1788851669012.png

5. save it