Form Builder
Build Power Apps forms visually and get generated YAML plus Patch formulas. No more manually creating dozens of input controls.
What is the Form Builder?
The Form Builder is a visual tool that lets you design forms by adding fields, then generates:
- YAML code for all the form controls
- Patch formula to save the data
- Reset formula to clear the form
Instead of dragging 10 text inputs onto a screen and configuring each one, you define your fields once and copy the generated code.
The Form Builder is a tool, not a component. You find it under "Form Builder" in the component library, and it opens a full-page builder interface.
Two Builder Types
Quick Form Builder
Single-page forms for straightforward data collection.
Best for:
- Contact forms
- Simple data entry
- Quick submissions
Features:
- Add fields with drag-and-drop
- Preview form layout
- Generate YAML + Patch formula
- Configure data source name
Multi-Step Form Builder
Wizard-style forms with multiple sections that guide users through a process.
Best for:
- Onboarding flows
- Complex applications
- Long forms split into digestible steps
Features:
- Multiple sections/steps
- Progress indicators
- Section headers
- Collapsible completed sections
- Edit previous sections
Getting Started
1. Go to Form Builder
Navigate to Form Builder and choose Quick Form or Multi-Step.
2. Add Fields
Click "Add Field" and choose from:
| Field Type | Use For |
|---|---|
| Text | Names, titles, single-line text |
| Text Area | Comments, descriptions, long text |
| Number | Quantities, ages, numeric values |
| Dropdown | Status, categories, fixed options |
| Date | Due dates, birthdays, scheduled dates |
| Toggle | Yes/No, Active/Inactive, boolean values |
3. Configure Each Field
For each field, set:
- Label - What users see ("Email Address")
- Variable - The control name in Power Apps (txtEmail)
- Required - Show asterisk indicator
- Options - For dropdowns, the list of choices
Use consistent variable naming: txt for text, drp for dropdown, dat for date, num for number, tgl for toggle.
4. Set Form Settings
In the Settings tab:
- Form Title - Heading displayed above the form
- Data Source - SharePoint list or Dataverse table name
- Columns - Layout (1 or 2 columns)
5. Copy Generated Code
Switch to the "Generated Code" tab and you'll see:
YAML Tab - The visual form controls
FormContainer:
Control: Container
Children:
- txtTitle:
Control: TextInput
Properties:
Default: ""
...
Patch Tab - Save formula
Patch(
YourDataSource,
Defaults(YourDataSource),
{
Title: txtTitle.Text,
Status: drpStatus.Selected.Value,
DueDate: datDueDate.SelectedDate
}
)
Reset Tab - Clear form formula
Reset(txtTitle);
Reset(drpStatus);
Reset(datDueDate);
Multi-Step Form Builder
For wizard-style forms with sections:
Creating Sections
- Click "Add Section"
- Give it a name ("Personal Info", "Company Details")
- Add fields to that section
- Repeat for additional sections
Section Behavior
- Users see one section at a time
- Progress bar shows completion
- Completed sections collapse and show a summary
- Users can click "Edit" to go back
Generated Output
Multi-step forms generate:
- YAML - All sections and fields
- OnStart - Variables for state management
- Patch - Combined save formula
- Reset - Clear all sections
- Variables Reference - Documentation of what each variable does
Using Generated Code
Step 1: Paste YAML
Copy the YAML and paste into Power Apps (right-click → Paste code in Tree view).
Step 2: Add OnStart (Multi-Step only)
Copy the OnStart code to your App.OnStart property.
Step 3: Add Submit Button
Create a button and set OnSelect to the Patch formula:
// For Quick Form
Patch(
SharePointList,
Defaults(SharePointList),
{
Title: txtTitle.Text,
Status: drpStatus.Selected.Value
}
);
Notify("Saved!", NotificationType.Success)
Step 4: Add Reset (Optional)
Add a "Clear" button with the Reset formula.
Field Types Reference
Text Field
Standard single-line text input.
// Access value
txtFieldName.Text
Text Area
Multi-line text for longer content.
// Access value
txtDescription.Text
Number
Numeric input with optional validation.
// Access value
Value(numQuantity.Text)
Dropdown
Selection from predefined options.
// Access selected value
drpStatus.Selected.Value
Date
Date picker control.
// Access selected date
datDueDate.SelectedDate
Toggle
On/Off switch for boolean values.
// Access value (true/false)
tglActive.Value
Best Practices
Naming Conventions
Use prefixes for clarity:
txt- Text inputsdrp- Dropdownsdat- Date pickersnum- Number inputstgl- Toggles
Validation
Add validation before Patch:
If(
IsBlank(txtTitle.Text),
Notify("Title is required", NotificationType.Error),
Patch(...)
)
Error Handling
Wrap Patch in error handling:
If(
!IsError(Patch(DataSource, Defaults(DataSource), {...})),
Notify("Saved!", NotificationType.Success),
Notify("Error saving", NotificationType.Error)
)
Form Reset After Save
Clear the form after successful submission:
Patch(...);
Reset(txtTitle);
Reset(drpStatus);
// ... reset all fields
Common Use Cases
Contact Form
- Name (text)
- Email (text)
- Message (text area)
- Submit button with Patch to SharePoint
Employee Onboarding (Multi-Step)
- Section 1: Personal Info
- Section 2: Emergency Contact
- Section 3: Equipment Requests
- Section 4: Document Upload
Support Ticket
- Title (text)
- Category (dropdown)
- Priority (dropdown)
- Description (text area)
- Due Date (date)
Troubleshooting
Form not appearing
Make sure you pasted the YAML correctly. The form should be inside a container.
Patch formula errors
Check that your Data Source name exactly matches your SharePoint list or Dataverse table name.
Fields not resetting
Make sure you're using Reset() on the correct control names.
Multi-step navigation broken
For multi-step forms, make sure you added the OnStart code and ran it (right-click App → Run OnStart).
The Form Builder generates forms but doesn't connect to your actual data source. You need to change "YourDataSource" in the Patch formula to your real SharePoint list or Dataverse table name.
