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 / Variable Gallery posit...
Power Apps
Answered

Variable Gallery position based on other galleries position

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

 

I have multiple galleries on a data card. These galleries can have nothing in them at times. I would like for the galleries below an unpopulated gallery to snap up to the nearest populated gallery. Otherwise there are gaps in the data card (ex. the picture below)

 

Gallery Height1.PNG

Thanks

Categories:
I have the same question (0)
  • rsaikrishna Profile Picture
    3,703 on at

    @Anonymous 

     

    In Gallery height property, you set desired height based on the check.

     

    if(CountRows(gal1.AllItems) = 0, 0,200)

     

    Give a try.

     

    Regards

    Krishna Rachakonda

    If this reply helped you to solve the issue, please mark the post as Accepted SolutionMarking this post as Accepted Solution, will help many other users to use this post to solve same or similar issue without re-posting the issue in the group. Saves a lot of time for everyone.
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    My problem isn't with the Gallery Height (I already have a condition for that that is working fine). I need the Gallery position to be variable

  • Verified answer
    GarethPrisk Profile Picture
    2,828 on at

    You can (should always) anchor controls to one-another.

    You can make Gallery2.Y equal to (Gallery1.Y + Gallery1.Height), for example. This works for most basic anchoring patterns, but can be expanded upon to include more dynamic/responsive formulas, and also should include some padding.

    You'll need to consider the context of the control, if you want to use Parent. (for example), because a control may be within a Card container, or a group/container.

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

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @GarethPrisk Beautiful, this is exactly what I was looking for. I'll start messing around with it.

     

    Thanks!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 547

#2
WarrenBelz Profile Picture

WarrenBelz 444 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 322

Last 30 days Overall leaderboard