This article provides a step-by-step guide for setting up a Power pages application and integrating the Syncfusion TreeGrid code component.
Power Pages is a low-code platform in the Microsoft Power Platform family, designed for creating secure and responsive external-facing business websites. It facilitates rapid development without extensive coding, integrates with data sources, and inherits robust security features from Microsoft Azure, making it a versatile tool for diverse website needs.
Syncfusion PowerApps TreeGrid code component requires data to be loaded from a data source. Follow the steps provided in Create a new Dataverse table section to create a new table in Dataverse using the CSV in the TreeGrid code component CSV data folder. Skip this step if you have an existing table with data.
When creating the Dataverse table using CSV file, ensure the column names and data types match those in the table below:
| Column Name | DataType |
|---|---|
| TaskID | Whole.none |
| TaskName | SingleLine.Text |
| StartDate | Date and Time data type column with the "Date Only" format. |
| Duration | Whole.none |
| Priority | SingleLine.Text |
| EndDate | Date and Time data type column with the "Date Only" format. |
| Progress | Whole.none |
| ParentID | Whole.none |
Note
When setting up a Dataverse, make sure that the table columns are assigned the correct data types to prevent data loading issues in the TreeGrid code component.
To add the Syncfusion PowerApps TreeGrid code component to the Dataverse table, follow the steps below:
-
In the Dataverse table, find the
Formstab in the Data experiences pane to streamline data management. Locate theInformationform with the main form type to define how users interact with and organize data effectively. -
Within the left navigation pane of the
Informationform, locate theComponentstab. Here, click onGet more componentsat the bottom of the tab. -
A window will appear. Switch to the
Build by otherstab at the top and import the built code component namedSfTreeGridfrom the published solutions. -
Create a new section in the form, opting for a
1-column tabfrom thepopularsection. Rename this tab as TreeGrid View to clearly delineate its purpose. This tab will be utilized to render the TreeGrid code component. -
Within the
More Componentssection, select theSfTreeGridcomponent. Configure the DataSource property of the TreeGrid code component by accessing the list of Dataverse tables created previously with respective table views. This step ensures that the TreeGrid code component is seamlessly connected to the relevant data. We can also configure the TreeGrid component by accessing optional TreeGridConfig property and pasting the TreeGridConfig.json. -
Once the data is loaded, set the
IdMappingproperty to the ID column, such asTaskIDand theTreeColumnIndexproperty to1to ensure that the fields are correctly mapped and the sample renders properly. Also, customize the other TreeGrid code component properties in the property pane. -
The output of the TreeGrid code component will appear as shown below. Click the
Save and publishbutton at the top right corner of the PowerApps portal. This action commits the changes made to the form, ensuring that the Syncfusion PowerApps TreeGrid code component is now an integral part of the Dataverse table.
To create a Power Pages application, follow the steps below:
-
In the Power pages portal, click the
Start from blankoption to create a new Power Pages application. And provide a meaningful name for your Power Pages application. Subsequently, clickcreateto proceed. -
The Power Pages platform will generate a blank Power Pages application based on your specifications. You are now ready to start building your application. The created application will be listed in
Active sitestab. Now. clickEditthe application to proceed. -
Then update the header title and logo by clicking the
Edit site headerbutton in the header section. And change the theme of the application toMossin theThemesection. Finally, click theSavebutton to save the changes. -
Add new section by clicking the
ADD A SECTIONbutton. And create a heading by choosingTextcomponent. -
Now click the
Formbutton under the title component to add the previously created table form contains Syncfusion TreeGrid code component. And choose theNew Formoption to select a new form. In that, select the previously created table and its form. Finally, click theokbutton to save the changes. -
click the
New permissionbutton on top of the form to add the permission for the Dataverse table. And select the necessary permission for the table. Finally, click theokbutton to save the changes. -
After updating the permission, click
Edit formon the form component and selectdatatab on left pane. On that, click theOpen Portal Management appbutton under configuration section to open the portal management app in new tab. -
In the opened Portal Management app, click the
Basic Form Metadatatab of theInformationtable form. and create two new form metadata by clicking theNew Basic Form Metadatabutton. And provide the necessary details for the form metadata forTreeGrid Viewtab and the code component. Finally, click theSavebutton to save the changes. check below screenshots for reference. -
After updating the form metadata, navigate to the Power pages portal and click the
okbutton on the form component to save the changes. Finally, click theSyncon the top right corner of the Power pages application to synchronize the changes. -
Now, click the
Previewbutton on the top right corner of the Power pages application and clickDesktopto preview the application in new tab. The output of the TreeGrid code component will appear as shown below.











