Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
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 Dataverse 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.
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
Add a form to collect information from site visitors and save it in Microsoft Dataverse. You can describe the form you need to Copilot or select an existing Dataverse form.
Open your site in the Power Pages design studio, and then use either of the following methods. After you add the form, review its table permissions and preview the page.
This video provides an overview of the steps to add a form to a page.
Create a form with Copilot
Describe the information you want to collect, and then use Copilot to generate and refine the form. In this example, you create a volunteer sign-up form.
In the Pages workspace, select the page where you want to add the form.
In the section where you want the form to appear, select Form from the component bar.
Under Describe a form to create it, enter a description of the form. For example:
A volunteer sign-up form for trail days, with name, email, preferred weekday, and a comments box.
Select the arrow in the prompt box to generate the form.
Review the generated form in the preview.
To change the form, enter a request under Do you want to make any changes?, and then select the arrow. For example:
Add a phone number field.
Review the updated form, and then select OK to add it to the page.
Note
Copilot results can vary. Review the generated fields and collect only the personal data you need for the form's purpose.
Add an existing Dataverse form
Select a form from a Dataverse table instead of generating one with Copilot. In this example, you use the Feedback form from the Feedback table.
In the Pages workspace, select the page where you want to add the form.
In the section where you want the form to appear, select Form from the component bar.
Under Other ways to get started, select New form.
In the Add a form dialog, under Choose a table, select Feedback.
Under Select a form, select Feedback, or select the form you created previously for that table.
In Name your copy of the selected form, enter a descriptive name, such as Visitor feedback.
Select OK to add the form to the page.
Configure table permissions
Table permissions determine which site visitors can submit information. Review the permissions for the table used by your form. The following steps use the Feedback table permission shown in this example.
Select the form on the page, and then select Permissions on the form toolbar.
In the Table permissions pane, select Feedback.
On the Basic tab, confirm that Table is set to Feedback.
For this example, set Access type to Global access.
Under Permission to, select Create so visitors can submit new records.
Under Roles, select Add roles, and then select Anonymous Users and Authenticated Users to allow submissions from visitors who aren't signed in and visitors who are signed in.
Close the role selector, and then select Save.
Important
Include Anonymous Users only if you want visitors who aren't signed in to submit the form. Grant only the permissions your form needs. For this example, visitors need Create, not Read, Update, or Delete.
Preview the form
Preview the page to check how the form appears to site visitors.
Close the permissions pane, and then select Preview in the design studio.
Select Desktop to open the site in a new tab.
Review the form on the page and confirm that the expected fields appear.
Enable code components on form fields
This video provides an overview of the steps to configure the rich text editor control on a form.
If a Dataverse form field has been configured to use a code component using the Data workspace or a model-driven app, you can enable the code component to be used when a form is used on a webpage.
To enable a code component:
Select the Edit code component button from the menu.
Switch the Enable custom component field toggle switch to the on position.
Custom components are now enabled for that field.
From the design studio, select Preview and navigate to your page.
The form should show the rich text editor controls on the field.
Enable attachments on forms
This video shows how you can enable attachments on forms.
Users can upload an attachment with form submission.
To enable attachments on a form:
Add a form or edit an existing form.
In the Add a form modal, choose Attachments from the left panel.
- Configure the following options:
- Turn on/off the Enable attachments toggle.
- Turn on/off the Attachment is required toggle.
- Turn on/off the Allow multiple files toggle.
- Max file size allowed
- Configure the following options:
Note
The following file types are allowed:
- All
- Audio
- Document
- Image
- Video
- Specific (comma separated values)
Once configured, the file upload placeholder will show in the canvas.
Next steps
Next, learn how to create a multi-step (advanced) form to your page.