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

Create a form

This video provides an overview of the steps to create a form.

  1. Go to Power Pages.

  2. In the data workspace, select the Feedback table and choose the Forms tab.

    Theforms menu option for the feedback table in the data workspace.

  3. Select + New form to open the form editor.

    The + New form menu tile inside the forms menu item.

  4. Fill in the details.

    • Give the form a name. You can also add a description if you'd like one.

    • Select Create.

      Create a new form field.

  5. Modify the form using the Add field menu option, or by dragging and dropping existing fields to reorder them.

  6. Select Publish form.

    Publish form button inside the data workspace.

  7. Select Back.

    The back menu option.

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.

  1. In the Data workspace, select the Feedback table and choose the Forms tab.

  2. Select the form you created earlier.

  3. Select the Comments field on the form.

  4. In the right-hand section, choose Components and select the Rich Text Editor control.

    The Rich Text Editor Control option in Add component.

  5. 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.

  1. Open a Power Pages site in the design studio.

  2. Choose the + icon next to Main Navigation to add a new page.

  3. Fill in the details.

    • Give the page a name.
    • Choose the Start from Blank template.
    • Select Add.

    Details for your new page.

  4. Select Form from the component bar.

    THe form icon from the component bar.

  5. Select + New form.

    Add a form window.

  6. Fill in the details.

    • Select the Feedback table.
    • Select the form you created previously.
    • Select Ok.

    Details for Add a Form

  7. Select the Permissions button.

    The permissions button.

  8. Select Feedback permissions.

    • Ensure the Create privilege is checked and that Anonymous and Authenticated web roles are linked.

    Options for setting feedback permissions.

  9. Select Preview page.

    Preview icon.

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.

  1. In the design studio, open a page with a form component and select the form you previously created.

  2. Select the Form button.

    Form menu bar options.

  3. Select the Data section. Select Open Portal Management app. You'll be directed to the form metadata record.

    The form data tab.

  4. Select the Basic form metadata tab.

  5. Choose New basic form metadata.

    New Form Metadata tab.

    • Choose Attribute for the Type.
    • Choose Comments for the Attribute Logical Name.
    • Choose Code component for the control style.

    Choosing values for form metadata.

  6. Select Save.

  7. From the design studio, select Preview and navigate to your page.

  8. The form should show the rich text editor controls on the field.

    Feedback form with rich text editor control on comments.

Next steps

Next, learn how to create a multi-step (advanced) form to your page.