Gallery control in Power Apps is a control that contains other controls and shows a set of data. A Gallery control can show multiple records from a data source, and each record can contain multiple types of data. For example, you can use a Gallery control to show multiple contacts with each item showing contact information that includes a name, an address, and a phone number for each contact. Each data field appears in a separate control within the Gallery control. And you can configure those controls in its template. In this tutorial we will see how to create a navigation menu using the Gallery control.
How to create a navigation menu using the Gallery Control
- Add Vertical Gallery.
- Connect Data and Edit layout.
- Set the Size of the Gallery control item.
- Change the Fill color of the Gallery control and color of the Screen.
- Add a Rectangle and a Text label.
- Change the Size and Color of the Text label.
- Duplicate and rename the Screen.
- Add a Text label control in the Gallery control.
- Change the Text label control Text property.
- In the Gallery control change on the “OnSelect” property.
- Run an app.
Key properties of Gallery control
- Default – The item or record from the data source to be selected in the gallery when the app starts up.
- Items – The source of data that appears in a control such as a gallery, a list, or a chart.
- Selected – The selected item.
- DisplayMode – Whether the control allows user input (Edit), only displays data (View), or is disabled (Disabled).
- Fill – The background color of a control.
- Height – The distance between a control’s top and bottom edges.
- Visible – Whether a control appears or is hidden.
- Width – The distance between a control’s left and right edges.
Formulas in this tutorial
Text Label control
Text = ThisItem.ScreenName
Gallery control
OnSelect = Switch( ThisItem.'Screen Name', "CasualScreen", Navigate( CasualScreen, ScreenTransition.Fade ), "ContractScreen", Navigate( ContractScreen, ScreenTransition.Fade ), "FixedTermScreen", Navigate( FixedTermScreen, ScreenTransition.Fade ), "RegularScreen", Navigate( RegularScreen, ScreenTransition.Fade ) )
Microsoft Power Apps documentation: Gallery control in Power Apps