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 Apps
Suggested Answer

Disabled button

(1) ShareShare
ReportReport
Posted on by 118

 
If(
    Gallery1.Selected.'Category Version' = Last(
        Filter(
            Gallery1.AllItems,
            'CAT ID' = Gallery1.Selected.'CAT ID'
        )
    ).'Category Version',
    DisplayMode.Edit,
    DisplayMode.Disabled
)

Hi everyone,

Trying to understand why this code doesn't let one of my colleagues access to the "update template" button.
It greys out for him. He is the author of the category that is selected in the gallery. The code is copied here for that button.

Also, can you please explain this code to me, what this code is doing?
Categories:
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,968 Super User 2026 Season 2 on at
    Hi,
     
    Its nearly impossible to tell you since you dont share the data.
     
    But clearly they aren't equal, so that tells me the Sort Order is wrong, so when you do Last its not grabbing the row you think it should.
     
    Super easy for you to see by simply adding a Text Label.
    Set the Text property to your Last Query
    Last(
            Filter(
                Gallery1.AllItems,
                'CAT ID' = Gallery1.Selected.'CAT ID'
            )
        ).'Category Version'
     
    Then see if the Result matches what you think it needs too.
    If not make sure your sorting properly so last is actually what you want.
     
  • curiousperson01 Profile Picture
    118 on at
    @FLMike
    I am not sure if I follow. I am new to power app, I'd appreciate if you can break it down for me.
  • curiousperson01 Profile Picture
    118 on at
    FLMIKE,
    I tried but I don't think I follow what to look for.

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 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard