In this tutorial, you’ll learn how to work with Power Apps Gallery controls — both vertical and horizontal — and how to build an interactive movie catalog app using Excel as the data source.
Getting Started
- Open Power Apps and create a new blank canvas app.
- Name your app (e.g., PowerFlix) and click Create.
- Add a rectangle and a label to create a basic header. Set the label text to
PowerFlix
, centralize it, and style it (e.g., bold, white text).
Connecting to Excel Data
Use Excel Online as your data source. The Excel file should include movie details such as:
- Movie title
- Year
- IMDb rating
- Description
- Main actors
- Director
- Image URL
In Power Apps, go to the Data tab → Add data → search for “Excel” → choose Excel Online (Business) → connect to your file and select the table.
Creating a Vertical Gallery
- Go to Insert → Layout → select Vertical Gallery.
- Choose your Excel table as the data source.
- Select layout options (e.g., image, title, subtitle).
- Bind each field in the gallery to the appropriate Excel column using the
Text
orImage
property.
Example Field Bindings
- Image:
ThisItem.Image
- Title:
ThisItem.Movie
- Subtitle:
ThisItem.IMDBRating
Formatting the Gallery
You can customize the appearance of the gallery:
- Resize images and text
- Change font size, color, weight
- Format based on selection using
If(ThisItem.IsSelected, "Color")
Displaying Selected Item Details
To show details of the selected movie, add labels outside the gallery and bind them using the Gallery.Selected
property:
Gallery.Selected.Movie
Gallery.Selected.Description
Gallery.Selected.Director
Gallery.Selected.Actors
Format these labels for better readability. Use conditional visibility based on whether an item is selected using:
If(IsBlank(LabelMovie.Text), "", "Director")
Conditional Formatting
Power Apps allows you to highlight or label certain records using formulas. For example, mark top-rated movies:
If(Value(ThisItem.IMDBRating) > 8, "Top Pick", "")
To change background color conditionally:
If(Value(ThisItem.IMDBRating) > 8, RGBA(255, 204, 204, 1), RGBA(255, 255, 255, 1))
Removing Default Selection
By default, a gallery item is pre-selected. You can disable that:
Default = {}
Then, conditionally show or hide labels using:
If(IsBlank(Gallery.Selected.Movie), false, true)
Creating a Horizontal Gallery
- Insert a new screen.
- Add a Horizontal Gallery from the Layout tab.
- Set the data source to the same Excel table.
- Bind fields similarly: Image, Movie Title, IMDb Rating.
- Resize and format for horizontal scrolling.
Example Bindings for Horizontal Gallery
- Image:
ThisItem.Image
- Title:
ThisItem.Movie
- Rating:
ThisItem.IMDBRating
Conclusion
Power Apps galleries are powerful tools for displaying and interacting with collections of data. Whether vertical or horizontal, they allow for deep customization, formatting, and conditional logic, enabling you to build rich, dynamic interfaces using simple formulas.
Explore further with other Power Apps controls, or extend your app with navigation, forms, or Power Automate workflows!
Leave a Comment