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 / How to change gallery ...
Power Apps
Answered

How to change gallery WrapCount on a button click?

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello all,

 

I want to change the item size (WrapCount) of a vertical gallery based on user input and button click. I would think that you could do that by using button's OnSelect method with something like this: Gallery.WrapCount = Value(TextInput.Text) but Gallery.WrapCount property doesn't seem to be accessible outside of gallery itself. Any ideas?

 

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    You cannot assign values to a property like that in PowerApps.  PowerApps is a no-code platform and derives its values from formulas, much like Excel.  Just as in Excel, you would not try to set some other cell to a value, instead you would put a formula in the other cell to derive its value from the first. 

    That said...the Gallery has a WrapCount property.  In that property you can (given your above scenario) set the property to the following formula : Value(TextInput.Text)

    When TextInput is changed, the Gallery will change its wrap count based on that value entered.

     

    I hope this is helpful for you.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    It's not exactly what I'm looking for but maybe it can be useful for future as a work-around solution. Thanks!

  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 
    Can you describe more about what you are looking for then?  This is the only what you can set properties in PowerApps.

     

    If it is that you want this to be based on a button, then you can take a snapshot of the value in the textinput and use that.  

    For example, in the OnSelect of your button - UpdateContext({lclWrapCount:Value(TextInput.Text)})

    Then in the WrapCount of the Gallery, the following formula : lclWrapCount

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    This exactly what I needed. Thank you!

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 345 Most Valuable Professional

#2
11manish Profile Picture

11manish 207 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 177

Last 30 days Overall leaderboard