Power Pages – Add Advanced Client-Side Functionality
Get link
Facebook
X
Pinterest
Email
Other Apps
Power Pages – Add Advanced Client-Side Functionality Exercise
Step-by-step lab to enable portals Web API, retrieve Dataverse data, and render it as a chart using an external library.
What Is Sample Data?
Sample data is a set of pre-built records that Microsoft provides to help you understand how data is structured and how features work inside Dataverse and Power Pages. It populates common tables with realistic content so you can quickly test functionality without creating all records manually.
When sample data is installed in a Dataverse database, it adds a variety of records across multiple standard tables which you can use for development, learning, or demos.
What Sample Records Are Included
The sample dataset adds records that help you experiment with core tables like:
Accounts - companies with names and revenue data
Contacts - people associated with accounts
Opportunities and related sales data
Products and price lists
Cases, activities, and support records
For example, once sample data is installed you can run a Web API query against the Accounts table - with names, number of employees, and revenue values already populated - which can be used to generate meaningful charts in your exercise.
How to Install Sample Data
You can install sample data from the Power Platform Admin Center if your environment has a Dataverse database:
Open the Power Platform Admin Center and select your environment.
Select Settings and Data Management > Sample data.
If not already installed, choose Install Sample Data and wait for it to finish.
Once installed, you will see sample records across standard tables - providing ready-made data to test Web API calls, charts, forms, lists, and more.
Why Use Sample Data for Your Exercise
Sample data saves time and ensures your exercises produce visible results:
Provides realistic account and contact records
Helps test Web API GET queries without creating dozens of records
Makes charts and lists meaningful rather than empty
Lets you explore relationships between tables
Useful for learning filters, views, and data-driven components
Step 1 - Enable Portals Web API Access
Before you can pull data using Web API, you must configure site settings and table permissions.
Create Site Settings
Sign in to the Power Pages maker portal.
Select your environment in the top right.
Click the ellipsis (…) and open the Power Pages Management App.
Go to Site Settings and create a new setting:
Name: Webapi/account/enabled
Website: (select your portal)
Value: true
Save the setting.
Create another setting:
Name: Webapi/account/fields
Website: (select your portal)
Value: name, numberofemployees, revenue (logic name of Dataverse table column)
Save & close.
These settings whitelist the Accounts table for Web API read operations and specify which fields are accessible.
Step 2 - Create Table Permissions
Table permissions determine who can use the Web API to read account records.
Return to the Power Pages maker and open Design Studio.
Go to the Security workspace → Table permissions.
Click + New permission and enter:
Name: Account
Table: Account (account)
Access type: Global
Permission to: Read
Click Add roles and include:
Anonymous Users
Authenticated Users
Select Save.
This allows both public and logged-in visitors to query account data via the Web API.
Step 3 - Test the Web API
Open a new browser tab and run the following URL (replace with your portal URL):
You should see a JSON response containing account data with fields you enabled.
Step 4 - Create a Content Page
Now you’ll add a new page where you’ll embed JavaScript to retrieve and transform Web API data.
Open Design Studio → Pages workspace.
Click + Page.
Enter Chart as the page name and include it in main navigation.
Select Start from blank layout and click Add.
Select Edit code for the new page.
Open the generated .customjs.js file in Visual Studio Code.
Step 5 - Add JavaScript to Retrieve Data
Insert the following script logic to fetch data and prepare it for plotting. This code retrieves account records using the Web API, transforms the results, and logs the output.
Save the file and sync changes so the site can load this script.
Then open the page in preview mode. And open developer tool and check the console. Verify that the console output contains the same data as previously retrieved, except that it's now showing as transformed.
The data structure is now prepared for plotting. Assign the appropriate labels to data points:
name - Company name x - Number of employees y - Company revenue in thousands z - Revenue for each employee (calculated)
Step 6 - Add External Chart Library
To visualize the transformed data, include Highcharts.js in your portal footer:
Intro In this post I’ll walk you through how I set up a code-based app for Power Apps (React/Vite front-end + Power Platform CLI for packaging/deployment), the exact errors I ran into, and how I solved them. If you want a hands-on, copy-paste able guide that covers Node versions, pac auth, environment issues, and packaging tips, this is for you. Prerequisites Microsoft 365 account with access to a Power Platform environment Node.js ( 20.19+ recommended LTS) VS Code Install power platform tools extension in VS Code. Steps: Step 1 : Open Visual Studio Code and launch the integrated terminal. Step 2: In the terminal, run the following commands one by one. mkdir D:\CodeApps - Force cd D:\CodeApps npm create vite @latest myfirstapp -- -- template react - ts cd D:\CodeApps\myfirstapp npm install Initially, I ran the command: npm create vite@latest MyFirstApp -- --template react-ts This gave the error: Invalid package.json name The issue was caused because package...
Step 1: You should have an Azure subscription, or if you have access to the Microsoft Entra Admin Center, you can create an app from there. This app can then be used in Power Automate to connect to Microsoft Graph API. Step 2: Click on "New registration" , provide a name for your app, assign the required API permissions (such as Microsoft Graph permissions), and then click "Register" to complete the app registration process. Step 3: After registration, you'll be redirected to the app's overview page. From there, navigate to the API permissions tab and click "Add a permission" to assign the necessary Microsoft Graph API permissions. Step 4: Select Microsoft Graph as the API, and based on your requirements, choose the appropriate permissions. In my case, I selected Application permissions , which do not require user sign-in and are suitable for background services or automation. Step 5: Select the required Microsoft Graph API permissions. Yo...
Step 1: Open Power Automate, navigate to the Custom Connectors tab, and select Create from blank as shown in the image below. custom connector(click image for better resolution) Step 2: In the General tab, upload an icon (less than 1MB), add a description, select the correct scheme (in my case, HTTPS ), and provide the host name. For example, if your API URL is https://graph.microsoft.com/v1.0/users/{email} , the host name will be the highlighted part — graph.microsoft.com . Step 3: Go to the Security tab. Here, you need to select the authentication method. Choose OAuth 2.0 as the authentication type, as shown in the image below. Step 4: Select the Identity Provider as Azure Active Directory . Check the box Enable Service Principal Support . This option allows you to create a connection using a Client ID and Client Secret instead of using the user's own authentication. Next, provide the Client ID , Client Secret , Tenant ID , and other required details as shown in t...
Comments
Post a Comment