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 limit a gallery...
Power Apps
Answered

How to limit a gallery to one row

(0) ShareShare
ReportReport
Posted on by 56

Hello everyone, 

I'm trying to create a gallery that only support one row, but I'm struggling iwth it, should i disable the submission button after adding on row, going to OnVisible -> If(Len(Requester=1),false). 

The thing is that the formula is not working can you 

Categories:
  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    Hi @joao_guerreiro,

     

    If you only want to allow the user to select a button if the gallery contains 1 record, you could use the following code in the DisplayMode property of the button:

     

    If(
     //Change galleryName with the actual name of the gallery
     CountRows(GalleryName.AllItems) = 1,
     DisplayMode.Edit,
     DisplayMode.Disabled
    )

     

    If this solves your question, would you be so kind as to accept it as a solution.

    Thanks!

  • TheRobRush Profile Picture
    11,128 Moderator on at

    Do you want it to only show one row at a time, but you can still scroll through each record (settings its template size to self.height for vertical and self.width for horizontal)? Or do you only want one record to be in the gallery (this would be changing its datasource to only return one record)

  • joao_guerreiro Profile Picture
    56 on at

    I just want to add one row to a collection.

  • TheRobRush Profile Picture
    11,128 Moderator on at

    put a button or icon in there and

    ClearCollect(collectionName, ThisItem)
  • joao_guerreiro Profile Picture
    56 on at

    It worked great, 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

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 381 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 340

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard