How can we help you today?

How to Dynamically Display a SharePoint Group Member Count on Your SharePoint Page

With the REST API connection, you can get the total number of members in a SharePoint group and connect it to a Design Element.  This solution will display a live member count that updates automatically on your SharePoint page. Follow the steps below to learn how to accomplish this.


sample connected design element


NOTEFor this guide, we will be using the Counter Boxes Design Element. However, you can use any Design Element you prefer.

TABLE OF CONTENTS


Prerequisites

  • You must have the latest version of ShortPoint SPFx installed on your SharePoint environment.
  • You must be a ShortPoint Designer with an active license.
  • You must already have the Design Element you want to use to connect on your SharePoint page.

Step-by-step Tutorial

Follow the steps below to learn how to get the total number of members in a SharePoint group and connect it to a Design Element:


Step 1: Edit the ShortPoint Web Part

Go to the SharePoint page you want to use and click Edit:


Edit


Close the Toolbar:


close icon


Edit the ShortPoint web part:


Edit properties icon


Step 2: Switch to Grid Mode


NOTEShortPoint Connect is currently only available in Grid Mode.


Click the Switch to Grid Mode icon:


Switch to Grid Mode icon


Step 3: Edit the Design Element


NOTEFor this guide, we will be using the Counter Boxes Design Element. However, you can use any Design Element you prefer.


Click the cogwheel icon of the Design Element you’ll use:


cogwheel icon


Step 4: Connect to People in SharePoint Group

Go to the Connect tab:


connect tab


Select People in SharePoint Group:


People in SharePoint Group


Select the [1] name of the group you want to use and click [2] Connect:


Connect


Step 5: Get the REST API URL

Right-click anywhere and click Inspect:


right-click and inspect


The Devtools will open in a separate window. Go to the Network tab:


Network tab


Look for users?$orderby= and click it:


users?$orderby=


Copy the URL in the Request URL field:


copy URL


Step 6: Disconnect

Go back to the SharePoint page and click Disconnect:


Disconnect


Select Back to Connections:


Back to Connections


Step 7: Connect to REST API

Select REST API:


REST API


Paste the URL you copied in Step 5 in the field provided:


Paste URL


Toggle on Enable Advanced Settings


enable advanced settings


Copy the code below:

const length = data.d.results.length;
return [{length: length}];

Paste the code in the Map Results field:


paste in map results


Select Connect:


Connect


Step 8: Map Items

Go to the Items tab:


Items tab


Delete the default content:


delete default content


In the Counter Number field, click the [1] link icon and select [2] length:


link icon


Write the [1] Title  and choose an [2] Icon:


title and icon


Step 9: Save

Click Preview to see how the Design Element will look:


Preview


Once satisfied, click Update:


Update


Select the eye icon to see your page in real-time:


eye icon


Save your changes:


Save


That’s it! You can now connect a Design Element to the total number of members in a SharePoint Group.


Related articles:

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.

World's best intranet sites are designed using ShortPoint

Get started today! Learn more
See all 36 topics

Start a trial

Ignite your vision. Install ShortPoint directly on your site, or play in sandbox mode. No credit card required.

Get started today

World’s best intranet sites are designed using ShortPoint

Thousands of companies using ShortPoint everyday to design, brand and build award winning intranet sites.

Get started Learn more