Tutorial: Add a form to your page
Power Pages allows you to add form components to a page to allow your users to be able to create, edit, or view Microsoft Dataverse records.
Forms on pages are created from Microsoft Dataverse table forms.
This tutorial shows you how to create and add a form to your page, capture rich information through code components, and configure form actions when the information in the form is submitted.
In this tutorial, you learn how to:
- Create a form
- Add code components
- Add a form to a page
- Configure code options
Prerequisites
- A Power Pages subscription or trial. Get a Power Pages trial here.
- A Power Pages site created. Create a Power Pages site.
- Complete the Add and design a page tutorial.
- Complete the Display data securely on pages tutorial.
Create a form
This video provides an overview of the steps to create a form.
Go to Power Pages.
In the data workspace, select the Feedback table and choose the Forms tab.
Select + New form to open the form editor.
Fill in the details.
Give the form a name. You can also add a description if you'd like one.
Select Create.
Modify the form using the Add field menu option, or by dragging and dropping existing fields to reorder them.
Select Publish form.
Select Back.
The form will appear in the list of forms for that table.
See also
Add code components
Code components can be added to forms to allow advanced interaction with specific data fields. For example, we can enable rich text editing capabilities to a multi-line text field on a form.
This video provides an overview of the steps to add code components.
In the Data workspace, select the Feedback table and choose the Forms tab.
Select the form you created earlier.
Select the Comments field on the form.
In the right-hand section, choose Components and select the Rich Text Editor control.
Select Done.
The form now has a code component linked to the field.
Add a form to a page
The following steps provide details on how to add your form to a page.
This video provides an overview of the steps to add a form to a page.
Open a Power Pages site in the design studio.
Choose the + icon next to Main Navigation to add a new page.
Fill in the details.
- Give the page a name.
- Choose the Start from Blank template.
- Select Add.
Select Form from the component bar.
Select + New form.
Fill in the details.
- Select the Feedback table.
- Select the form you created previously.
- Select Ok.
Select the Permissions button.
Select Feedback permissions.
- Ensure the Create privilege is checked and that Anonymous and Authenticated web roles are linked.
Select Preview page.
Configure form options
Earlier we enabled the rich text editor component on the comments field in our form. In order for the rich text editor to render on the page, we need to add some metadata.
This video provides an overview of the steps to configure form options.
In the design studio, open a page with a form component and select the form you previously created.
Select the Form button.
Select the Data section. Select Open Portal Management app. You'll be directed to the form metadata record.
Select the Basic form metadata tab.
Choose New basic form metadata.
- Choose Attribute for the Type.
- Choose Comments for the Attribute Logical Name.
- Choose Code component for the control style.
Select Save.
From the design studio, select Preview and navigate to your page.
The form should show the rich text editor controls on the field.
Next steps
Next, learn how to create a multi-step (advanced) form to your page.
Feedback
Submit and view feedback for