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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Force Gallery to Scrol...
Power Apps
Unanswered

Force Gallery to Scroll to First Record (Back to Top)

(0) ShareShare
ReportReport
Posted on by

Is anyone aware of a way to force a Gallery of items to scroll directly to the top?  For example, I have a gallery that typically contains 50 to 100 job details and only 12 can show on the screen at a time.  Users can scroll or page down the list to find the desired job.  I would like to have a button or automatically force the scroll back to the top record and have not found a way to do this.  If a method does not exist, this would be a great feature to add (Back to Top).

Categories:
I have the same question (0)
  • Verified answer
    dinusc Profile Picture
    Microsoft Employee on at

    Hello @KarlHoffmaster,

    You should be able to scroll to the top element of the gallery by setting the following formula in Gallerie's "Default" property: 

    First(YourSource)

    Where YourSource is the source name your gallery is bound to. Note howether that the scroll to top event will be triggerend when that property changes. What you could do is to set the Default element to the currently selected item and then to the first item. Example:
    Button1.OnSelect=Set(dd, Gallery1.Selected);Set(dd, First(YourSource))

    Gallery1.Default=dd

    Clicking on the button should cause the Gallery1 to scroll all the way up.

     

     

  • Klewis Profile Picture
    61 on at

    Has anyone gotten this to work?  It did not work at all.  If I understood correctly.....I applied your code to my button, then back on my gallery Default property, I put in dd.   The result was when I click on the button, it just clears out the selected item.  

    Did you test this on your end before posting?

  • Community Power Platform Member Profile Picture
    on at

    This is how I got it to work. I created a "Search" text box to enter the item to search for to bring to the top of the gallery. For my app, it is a 6 digit job number. I set my gallery's "Default" value to the following: IF(Len(JobSearch.Text) = 6, First(Sort(Filter(DATA_Source, JobSearch_txt.Text = JobNumber),JobNumber , Ascending)), First(Sort(Filter(DATA_Source, Original Filter Criteria), SORTField, Ascending)))

  • JADANL123 Profile Picture
    26 on at

    I tried all of your recommended solutions and it didn't work properly. The solution for me was to just simply reset the gallery by changing the OnVisible property of the screen to Reset(YourGallery). Couldn't find this easy solution anywhere so use it to your advantage.

  • romankorchak2 Profile Picture
    125 on at

    Set Gallery Default to First(WhatYouHaveInItemsProperty)

    That worked for me

  • aroraans1 Profile Picture
    6 on at

    Reset(Gallery) on onvisible property of gallery

  • AA-27092239-0 Profile Picture
    on at
    I set up a timer to 100 miliseconds to then reset the gallery - this worked. I did have the Default set to First(Gallery) but that did not work.  The timer is set to autostart for when the view opens and then 100 ms duration, then reset gallery. 

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard