Common Controls in Canvas Apps

Earn 25 points (50 with Pro) in two steps

  1. ① Read through the lesson — each section gets a ✓ as you scroll through it.
  2. ② When every section has a ✓, tap Complete lesson.

0 of 10 read · keep scrolling

✦ See fewer ads and earn double points — 50 a lesson instead of 25 — with Pro

Lesson: Mastering Common Controls in Canvas Apps

Introduction: The Building Blocks of Your Interface

When you start building a Canvas App in Power Apps, you are essentially acting as both a designer and a developer. Unlike Model-Driven apps, which rely on predefined layouts and forms, a Canvas App gives you a blank slate. This freedom is powerful, but it places the responsibility of user experience squarely on your shoulders. To create an application that is intuitive, functional, and efficient, you must master the common controls—the fundamental components that make up the user interface.

Common controls are the building blocks of your application. They are the buttons, text inputs, labels, and galleries that allow users to interact with your data. Understanding how these controls work, how to configure their properties, and how to make them communicate with one another is the difference between a prototype that feels "broken" and a production-ready tool that solves real business problems. This lesson will guide you through the essential controls you will use in almost every project, providing the technical depth and practical context you need to build with confidence.


Not read yet

The Anatomy of a Control

Every control in Power Apps, regardless of its purpose, is defined by its properties. These properties determine how the control looks (e.g., Color, Size, Font), how it behaves (e.g., OnSelect, OnChange), and what data it displays (e.g., Default, Items). When you select a control on the canvas, the property panel on the right side of the screen or the formula bar at the top allows you to manipulate these settings.

To become proficient, you must move beyond the visual editor and start writing expressions. Power Apps uses a formula language similar to Excel. If you can write an IF statement or a VLOOKUP in a spreadsheet, you can write logic for a Canvas App. The secret to success is understanding that every control is an object, and every property is a variable you can control dynamically.


Essential Input Controls

Input controls are the primary way users provide information to your application. Without them, your app would be purely informational—a digital brochure rather than a functional tool.

1. The Text Input Control

The Text Input control is the most common way to capture user data. Whether you are building a contact form, a search bar, or a comment box, you will rely on this control constantly.

  • Default Property: This sets the initial text. You can bind it to a variable or a field from a data source.
  • HintText Property: This provides a placeholder for the user, explaining what information is expected (e.g., "Enter your full name...").
  • OnChange Property: This is the logic that fires when the user finishes typing and clicks away from the box. It is perfect for validation or saving data to a variable.

Tip: Managing Data Entry Always use the Format property of the Text Input control. If you are collecting a phone number, set the format to Number to prevent users from typing letters. This reduces the need for complex validation logic later in your application.

2. The Dropdown and Combo Box Controls

When you want to limit user input to a specific set of choices, these controls are your best friends. The Dropdown is a simple list of items, while the Combo Box is more advanced, supporting search, multi-selection, and filtering.

  • Items Property: This is where you define your data source or a hardcoded table. For example: ["Option 1", "Option 2", "Option 3"] or a SharePoint list name.
  • SelectMultiple: A unique feature of the Combo Box that allows users to pick more than one item from the list.

3. The Toggle and Checkbox Controls

These are binary input controls used for true/false or yes/no scenarios. The Toggle is visually distinct, often used for settings, while the Checkbox is standard for forms.

Callout: Toggle vs. Checkbox Use a Toggle when you want to provide immediate feedback or change a state (e.g., turning on "Dark Mode" or "Enable Notifications"). Use a Checkbox when you are collecting data for a submission, such as "I agree to the terms and conditions." The cognitive load of a toggle is higher, so reserve it for significant state changes.


Not read yet

Display Controls: Presenting Information

Once you have captured data, you need to show it back to the user in a meaningful way. Display controls handle the layout and presentation of your information.

The Label Control

The Label is the simplest control, yet it is the most vital for accessibility and navigation. It displays text, but it can also be used to show calculated values.

  • Dynamic Text: You can combine static text with variables. For example: "Welcome, " & User().FullName.
  • Accessibility: Always ensure your labels are descriptive. If a button's purpose isn't obvious, place a label next to it to provide context.

The Gallery Control

The Gallery is the powerhouse of Canvas Apps. It allows you to display a list of items from a data source in a repeating layout. If you are building a list of inventory items, a directory of employees, or a feed of recent reports, you are using a Gallery.

  • Template: The Gallery uses a template (the first item in the list) to determine the layout for all subsequent items. Changing the design of the first item automatically updates every other item in the gallery.
  • Filtered Views: You can filter the gallery using the Items property. For example: Filter(Employees, Department = "Sales").

Not read yet

Building a Functional Form: A Step-by-Step Example

Let's walk through the process of building a simple user registration form. This will help you understand how these controls work together.

Step 1: Setup the Data Source For this example, assume we have a SharePoint list named "Registrations" with columns for "Name" (Text) and "Department" (Choice).

Step 2: Add a Form Control Go to the "Insert" tab and select "Edit Form." Connect this form to your "Registrations" list. Power Apps will automatically generate fields based on your data schema.

Step 3: Customize the Cards Each field in the form is wrapped in a "Data Card." You can unlock the card to change the specific input control. If you don't like the default dropdown for "Department," you can delete it and insert a Combo Box instead, re-binding it to the data source.

Step 4: Add a Submit Button Add a button outside the form. Set its OnSelect property to: SubmitForm(Form1)

Step 5: Add Success/Failure Feedback Set the OnSuccess property of the form to Notify("Registration successful!", NotificationType.Success). This provides the user with visual confirmation that their data was saved.


Not read yet

Best Practices for Control Management

As your app grows in complexity, managing your controls becomes a challenge. Follow these industry-standard practices to keep your app maintainable.

  1. Naming Conventions: Never leave controls named "Button1" or "TextInput2." Use a prefix system. For example, btn_Submit, txt_UserName, lbl_ErrorMessage. This makes your formulas much easier to read.
  2. Grouping: Use the "Group" feature to organize related controls. If you have a header section with a logo, a title, and a back button, group them together. This makes moving them around the screen much easier.
  3. Performance: Avoid putting complex formulas inside the Items property of a gallery if the data source is large. Instead, use a variable to store the filtered data and reference the variable.
  4. Accessibility: Always set the AccessibleLabel property for your controls. This ensures that users who rely on screen readers can understand what each control does.
  5. Consistency: Keep your design consistent. If your "Save" button is blue on the home screen, it should be blue on every other screen.

Not read yet

Common Pitfalls and How to Avoid Them

Even experienced developers fall into traps when working with Canvas App controls. Here are the most common mistakes and how to steer clear of them.

Pitfall 1: Over-nesting Controls

It is tempting to put galleries inside galleries or complex containers within containers. While this is technically possible, it significantly degrades performance and makes debugging a nightmare. Keep your hierarchy flat whenever possible.

Pitfall 2: Hardcoding Values

Hardcoding values like colors, data sources, or text labels directly into control properties makes your app rigid. Instead, use a "Theme" screen where you define global variables for colors and fonts. Reference these variables in your controls. If you need to change your brand color later, you only have to update it in one place.

Pitfall 3: Ignoring Delegation

Delegation is the ability of Power Apps to offload data processing to the data source (like SQL or SharePoint). If you use a function that cannot be delegated, Power Apps will only process the first 500-2000 records, leading to incomplete data. Always check the "Delegation Warning" yellow triangle in the formula bar to ensure your filters are efficient.

Warning: The 500-Record Limit By default, Power Apps limits the number of rows retrieved to 500, which can be increased to 2000 in settings. If your data source contains more rows, your app will fail to show all records if you don't use delegable functions. Avoid using functions like Search on large datasets if a Filter is more appropriate.


Not read yet

Deep Dive: The Power of Variables and Controls

To truly master controls, you must understand how they interact with variables. Variables act as the "memory" of your app.

  • Context Variables (UpdateContext): These are local to a specific screen. Use them for temporary states, such as showing or hiding a loading spinner.
  • Global Variables (Set): These are accessible throughout the entire app. Use these for user information, current settings, or data that needs to persist across multiple screens.

Practical Example: The "Loading" Spinner Suppose you want to show a loading icon while data is being fetched.

  1. Add an Icon (e.g., a circle) and set its Visible property to a variable: varIsLoading.
  2. When the user clicks a button, set UpdateContext({varIsLoading: true}).
  3. Once the data is fetched, set UpdateContext({varIsLoading: false}). This creates a smooth, professional experience for the user.

Not read yet

Comparison Table: Choosing the Right Input Control

When you are designing a form, it is often unclear which control is the best fit. Use this table as a quick reference.

Requirement Recommended Control Why?
Freeform text entry Text Input Best for names, notes, or descriptions.
Choosing one from a list Dropdown Simple, standard UI for small sets of data.
Choosing many from a list Combo Box Supports multi-select and filtering.
Yes/No or True/False Toggle Best for state changes (On/Off).
Accepting terms Checkbox Clearer intent for confirmation.
Selecting a date Date Picker Built-in calendar makes it error-proof.
Selecting a range Slider Good for numerical values without precise input.

Advanced Control Concepts: Containers and Layouts

Modern Canvas Apps use Containers to manage responsive layouts. A container is a layout control that holds other controls. It allows you to define how elements should behave when the screen size changes (e.g., from desktop to mobile).

  • Horizontal Containers: These arrange child controls side-by-side. You can set them to "wrap" so they drop to the next line on smaller screens.
  • Vertical Containers: These stack controls on top of each other. This is perfect for building consistent form structures.

Using containers is a best practice that replaces the "pixel-perfect" design approach of the past. Instead of setting exact X and Y coordinates for every control, you let the container calculate the positions. This makes your apps much more resilient to different screen resolutions.


Not read yet

Common Questions (FAQ)

Q: Can I change the color of a standard control? A: Yes. Almost all controls have properties for Fill, Color (for text), BorderColor, and HoverFill. You can customize these to match your organization's brand colors.

Q: Why is my dropdown not showing any data? A: Check the Items property. If you are using a SharePoint list, ensure you are referencing the correct column, and check if the column type in SharePoint is compatible (e.g., Choice columns need .Value appended to the reference).

Q: How do I make a control visible only to admins? A: Use the Visible property of the control. You can write an expression like User().Email = "[email protected]". Only users matching that email address will see the control.

Q: What is the difference between a "Form" and just individual controls? A: A Form control is a specialized container that handles data validation, submission, and resetting automatically. Using a Form is significantly faster than manually building every input and writing individual Patch functions for each one.


Not read yet

Summary and Key Takeaways

Mastering common controls is the fundamental step in transitioning from a beginner to an expert in Power Apps. By understanding how each control functions—and more importantly, how they interact with each other and your data—you can build applications that are not only functional but also a pleasure to use.

Key Takeaways:

  1. Properties are Everything: Every control is an object. Learn the properties (Visible, OnSelect, Default, Items) to control how your app behaves.
  2. Standardize Your Naming: Use consistent prefixes (e.g., btn_, lbl_, txt_) to keep your app organized and readable for other developers.
  3. Leverage Forms: Use the built-in Form control to handle data entry whenever possible; it automates validation and submission logic that would otherwise require complex custom code.
  4. Think About Accessibility: Always use the AccessibleLabel property and keep your UI clean and predictable so that all users can interact with your application effectively.
  5. Use Containers for Responsiveness: Move away from hard-coded X/Y coordinates. Use Horizontal and Vertical containers to build layouts that adapt automatically to different devices.
  6. Optimize for Performance: Be mindful of delegation limits. If you are working with large datasets, filter your data at the source rather than pulling everything into the app.
  7. Keep it Consistent: Use global variables to manage your color palette and theme, ensuring that your app looks like a cohesive product rather than a collection of mismatched parts.

By consistently applying these principles, you will build robust, scalable, and user-friendly Canvas Apps that meet the needs of your organization. Start small, experiment with the different properties of each control, and don't be afraid to test your logic in the preview mode to see how your users will experience the interface.

Not read yet

Each section gets a ✓ as you scroll through it. Tap the button to jump to the next one.