web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Image Gallery with Dyn...
Power Apps
Answered

Image Gallery with Dynamic Wrap Count

(0) ShareShare
ReportReport
Posted on by 467

Hello I am working on a responsive gallery for showing images that I am struggling with on how to setup a dynamics wrap count so the number of images in a row dynamically changes based upon a resolution range.  I say range as one can imagine when your resizing your browser you will cover ranges and not just hard limit resolutions that mobile uses.  I feel like I have a good handle on the rest of the app and its responsive elements however this one I am really struggling with.

 

For example in the formula below a 4k computer will qualify for both the first 2 If statements so it will actually result in 55 rather than 5.  The rest of the if statements are hard coded to a specific resolution and they do work however more or less not very desirable as they are not using ranges.  I was hoping to use around 4 ranges that would cover low, medium, high, and 4k ranges rather than hardcoding a pile of specifics which does not work well when resizing.  Any feedback on this is appreciated, I think I am just looking for some direction on using multiple ranges in a formula.

 

Examples of ranges

>= 3000   Wrap count 5

2000 - 2999 Wrap count 4

1000 - 1999 Wrap count 3

640 - 999    Wrap count 1

 

This is one I am testing and not working very well.

If(
Screen1.Width >= 3000,
5
) & If(
Screen1.Width = 3839,
5
) & If(
Screen1.Width = 2650,
4
) & If(
Screen1.Width = 2048,
4
) & If(
Screen1.Width = 2650,
4
) & If(
Screen1.Width = 1920,
3
) & If(
Screen1.Width = 720,
3
) & If(
Screen1.Width = 640,
1
) & If(
Screen1.Width = 999,
2
)

Categories:
  • Verified answer
    GarethPrisk Profile Picture
    2,828 on at

    PowerApps support screen breakpoints. By default, it has 3 or 4 but these are customizable. I recommend exploring these as a reliable mechanism for definition how/when you increment your wrap count.

     

    It basically defines a behavior function you can use in your formulas, instead of writing it the way you did. Plus it scales between desktop and mobile.

     

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/create-responsive-layout#custom-breakpoints

  • Dudditz Profile Picture
    467 on at

    Great stuff Gareth, this is exactly what I needed and works as expected.  Thanks for your guidance on this.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 397 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 354

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard