Controls in canvas apps are user-interface (UI) elements that allow interaction with the app. These may include labels, buttons, text input boxes, checkboxes, and more. When building a canvas app, controls can be dragged from the elements panel onto the canvas.
For instance, if you want to add a text input control to a canvas screen, you simply select the Text input control from the elements panel and drag it onto the canvas. You can then customize the control properties, like the display text, color schemes, and sizing, as desired.
Every control has a set of properties, events, and functions associated with it. Understanding these features provides a significant advantage when you’re adding and customizing controls.
Adding Controls to Canvas App Screens
Follow these steps to add controls to your canvas app screens:
- Open your canvas app and navigate to the screen where you want to add the control.
- Go to the Insert tab on the menu bar. You’ll find various control categories, like Input, Forms, and Data table, plus more complex control groupings such as “Galleries” and “Media”.
- Choose the type of control you want to add to your screen. For instance, if you select ‘Button’ from the ‘Button’ category, a Button control will appear on the canvas.
- Customise the control properties: select the control on the screen, and then change the properties in the Properties pane on the right.
- To bind the control to a data source, use the Data pane on the left.
Example: Adding a Button Control
As an example, let’s add a Button control that, when clicked, navigates the user to another screen.
- Open the appropriate screen and click ‘Insert’ > ‘Button’.
- A Button control will appear on the canvas. Click on the button to select it.
- Customise the button’s properties in the Properties pane: change the button’s text to ‘Next’.
- To make the button navigate to another screen, you will need to define an action for it. In the ‘OnSelect’ property, type the formula:
Navigate([ScreenName])
, where [ScreenName] is the name of the target screen. - Press ‘Enter’ to finish. Now, when the button is clicked, the app will navigate to the specified screen.
Remember, the efficiency of a canvas app largely depends on the controls. The more smartly and wisely you use these controls, the more interactive and user-friendly your app will be. Don’t hesitate to experiment with different controls and properties as you develop your canvas app.
Comparison of Some Common Controls
Control | Description |
---|---|
Label | Displays non-editable text. |
Button | Triggers an action when clicked. |
Text input | Allows users to enter text. |
Toggle | Acts as an on/off switch. |
Checkbox | Allows users to select multiple options. |
When preparing for the PL-900 Microsoft Power Platform Fundamentals exam, it is essential to understand the role and implementation of controls in canvas apps. This forms an integral part of designing and building effective Power Platform solutions.
Practice Test
True/False: You can add controls to canvas app screens in Microsoft Power Platform to create a more interactive user experience.
- True
- False
Answer: True
Explanation: Adding controls to canvas app screens allows you to create a more dynamic and interactive user experience in your Power Platform apps.
True/False: It is not possible to add an Image control to a canvas app screen in the Microsoft Power Platform.
- True
- False
Answer: False
Explanation: You can add a variety of controls, including Image controls, to canvas app screens in the Microsoft Power Platform.
Which controls can you add to a canvas app screen in the Microsoft Power Platform?
- a) Label
- b) Button
- c) Gallery
- d) All of the above
Answer: d) All of the above
Explanation: These controls allow the user to interact with the app and view and manipulate data.
What is the function of a Slider control in a canvas app screen in the Microsoft Power Platform?
- a) It allows the user to select a single value from a range.
- b) It allows the user to select multiple values from a range.
- c) It acts as a label to display text.
- d) None of the above
Answer: a) It allows the user to select a single value from a range.
Explanation: The Slider control is used to allow a user to select a single value along a continuum or range.
Can you add a Power BI Tile control to a canvas app screen in the Microsoft Power Platform?
- a) Yes
- b) No
Answer: a) Yes
Explanation: Power BI Tile control can be added to a canvas app screen. This can provide interactive Power BI visuals in your app.
True/False: You cannot modify the properties of a control in a canvas app screen in the Microsoft Power Platform.
- True
- False
Answer: False
Explanation: You can modify the properties of a control after you’ve added it to a canvas app screen, such as its appearance, behavior, and data options.
What control allows users to make selections from a list in a canvas app?
- a) Drop down
- b) Slider
- c) Power BI Tile
- d) None of the above
Answer: a) Drop down
Explanation: The Drop down control lets users select an option from a list of choices.
True/False: To delete a control from a canvas app screen, you need to delete the entire screen.
- True
- False
Answer: False
Explanation: You can delete a specific control from a canvas app screen without deleting the whole screen.
What control should be used to display a static text in a canvas app?
- a) Label
- b) Text input
- c) Button
- d) None of the above
Answer: a) Label
Explanation: Label control is used to display a piece of static text that cannot be edited by the users.
How many controls can be added to a single canvas app screen in the Microsoft Power Platform?
- a) Only one
- b) As many as required
- c) Up to 10
- d) Up to 100
Answer: b) As many as required
Explanation: There is no exact limit to the number of controls that can be added to a canvas app screen. The number of controls depends upon the complexity and requirement of the app.
True/False: It is mandatory to select a data source while adding a control in a canvas app.
- True
- False
Answer: False
Explanation: It is not mandatory to select a data source while adding a control. However, certain controls such as Gallery, Form, etc., would require a data source to function properly.
True/False: Within Power Apps, you can use formulas to define the behavior of controls on a Canvas app.
- True
- False
Answer: True
Explanation: Formulas can be used within Power Apps to specify how controls behave or interact within a Canvas app, much as you would in Excel.
What is the main purpose of adding controls to screens in a Canvas app?
- a) To display data
- b) To enable users to interact with the app
- c) Both a and b
- d) None of the above
Answer: c) Both a and b
Explanation: Controls can be used to both display data and enable user interaction within a Canvas app.
What does a ‘Form’ control in a Canvas App allow you to do?
- a) Add text
- b) Display and manipulate data from a data source
- c) Display images
- d) None of the above
Answer: b) Display and manipulate data from a data source
Explanation: The ‘Form’ control allows you view and edit data from a data source. It can work with standard and custom entities.
True/False: The ‘Media’ control in a Canvas App allows you to add images, audios, and video files.
- True
- False
Answer: True
Explanation: The ‘Media’ control can be used to add images, audio files and video files to a Canvas app. You can then set their properties to control how they behave within the app.
Interview Questions
What are the main controls that you can add to your canvas app screens in Power Apps?
The main controls that you can add include labels, text input, buttons, drop-downs, galleries, data tables, forms, media (e.g. images, audio, video), and charts or graphs.
How can you add a button to a canvas app screen?
To add a button, select the ‘Insert’ tab, then ‘Button’. A button will appear on the screen that you can move and resize as necessary.
What function is often associated with buttons in the canvas app?
Often buttons are used to navigate between screens, submit data to a data source, or trigger a specific process or action when clicked. This is done by defining a formula in the OnSelect property of the button.
How can you introduce a text input field in a canvas app screen?
To introduce a text input field, select the ‘Insert’ tab, then ‘Text’ -> ‘Text input’. A text input box will appear on the screen, which can be moved and resized. You can define its default value, data type, and more using properties.
How can you customize the appearance and behavior of controls in your canvas app?
You can customize the appearance and behavior of controls using properties. Each control has different properties which can be edited in the property pane or by setting a formula in the formula bar.
What is the function of a gallery control in a canvas app screen?
A gallery control is a flexible and powerful control that displays a set of records, allows users to browse, edit, and select them.
How are screens added to a canvas app?
Screens are added to a canvas app by clicking on the ‘New Screen’ button located in the tree view or the ‘Insert’ tab on the top menu.
What is the purpose of the form controls in a canvas app screen?
Form controls are used to display and edit data from a data source. They automatically generate their fields based on the data source schema.
How can a user add a drop-down menu to a canvas app screen?
A user can add a drop-down menu by selecting the ‘Insert’ tab and then choosing ‘Input’-> ‘Drop-down’. Once the drop-down menu appears, the user can populate it by setting its ‘Items’ property.
How can a data table control be added to a canvas app screen?
A data table control can be added by selecting the ‘Insert’ tab and then choosing ‘Data table’. The user must then set the ‘Items’ property to load data into the table from a data source.
What is the purpose of adding media controls like audio, video, or images to a canvas app screen?
Media controls like images can enhance the visual appeal of the app, audio can provide auditory feedback or instructions, and videos can provide dynamic and interactive content. Their source can be set to a URL or a field from a data source.
How can an app navigate between screens on a button click?
App can navigate between screens by setting the OnSelect property of a button to the Navigate function, with the screen to navigate to as its parameter.
How can a user add a chart or graph to a canvas app screen?
A user can add a chart or graph by selecting the ‘Insert’ tab and then choosing ‘Chart’. The control must then be configured to pull data from a data source and set its properties to determine how the data is displayed.
How can you delete a control from a canvas app screen?
You can delete a control by selecting it and then either clicking the ‘Delete’ button on the toolbar, pressing the Delete key on your keyboard, or choosing ‘Delete’ from the right-click context menu.
Can multiple controls perform the same action in a canvas app?
Yes, multiple controls can perform the same action. This is commonly used when the same action is required from different screens or sections of an app.