Automated SharePoint Dashboard provisioning made easy

12 Jun

One of the latest updates to SharePoint includes the Dashboard feature, which allows any SharePoint site to have a dashboard for displaying information to end users. Previously, the Viva Connections dashboard web part was only available on the Home Site if Viva Connections was set up. Now, custom dashboards can be created on any SharePoint site without requiring an additional license.

A dashboard can be created with edit permissions for both team and communication sites.

Similar to the Viva Connections dashboard on the Home Site, any adaptive card type can be used here: standard cards, cards created with the card designer, and custom SPFx cards with properties like audience targeting. The dashboard is saved as a page in the Site Pages library. On a page, the Dashboard web part can be used to display the cards configured in the Dashboard page.

In the properties of the page, a maximum number of cards can be set. When there are more cards configured, a ‘See all’ link appears.

A site can have one dashboard page, but multiple dashboard web parts can be used on the same page or other pages. The web part can be used on other pages within the same site or on pages in subsites of this site. The Dashboard web part can be used in any section type, including the new flexible layout section.

Currently, there is no option to manage or disable this feature.

Automated Provisioning of a Dashboard Page

Automated provisioning of a dashboard page was tested by creating a dashboard page, exporting it using Export-PnPPage, and recreating a page from this XML using Invoke-PnPSiteTemplate. The result was the page being created, but it didn’t function as a dashboard page: when selecting Manage Dashboard, a ‘Create’ button was shown instead of ‘Edit’, and the Dashboard web part didn’t display any configured cards.

After some investigation into the search properties, a difference was found! The managed property SPSitePageFlagsOWSCHCM contained the value DefaultDashboard;# on the real Dashboard page but was empty on the provisioned page. The name SPSitePageFlagsOWSCHCM suggests it’s a choice, automatically created managed property on the internal column OData__SPSiteFlags or Site Page Flags.

The contents of this column can also be displayed using REST:

<siteUrl>/_api/Web/Lists/getByTitle(‘Site Pages’)/items?$select=Title,OData__SPSitePageFlags

Summary

To automate the provisioning of a dashboard page, you need to provision a page and then set the Site Page Flags as follows:

  1. Get the provisioned dashboard page:

    $item = Get-PnPListItem -List SitePages -Query "<View><Query><Where><Eq><FieldRef Name='Title'/><Value Type='Text'>Dashboard</Value></Eq></Where></Query></View>"
  2. Set it to DefaultDashboard:

    Set-PnPListItem -List SitePages -Identity $item.Id -Values @{"_SPSitePageFlags" = "DefaultDashboard"}

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.