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 disable a butto...
Power Apps
Answered

How to disable a button if a current month value already exists in gallery in power apps

(0) ShareShare
ReportReport
Posted on by 22

How to disable a button if a current month value already exists in gallery (Created Date) in power apps.?

Can any one Suggest.?

Thanks in advance.

 

Categories:
  • Krishna_R Profile Picture
    525 on at

    Hi @SSDhul92 ,

    if the created date is date type column and the button is inside of gallery. you can try this in the displaymode property of your button

     

    If(Month(ThisItem.CreatedDt) = Month(Now()),DisplayMode.Disabled,DisplayMode.Edit)

     

  • SSDhul92 Profile Picture
    22 on at

    Hi @Krishna_R 
    The Button is outside the gallery. can you suggest in this scenario.

  • Verified answer
    Krishna_R Profile Picture
    525 on at

    @SSDhul92  you can try this

     

    If(IsEmpty(Filter(DataSource.CreatedDt, Month(CreatedDt) = Month(Now()))),DisplayMode.Edit,DisplayMode.Disabled)
    
    or
    
    If(IsEmpty(Filter(Gallery.Allitems, Month(CreatedDt) = Month(Now()))),DisplayMode.Edit,DisplayMode.Disabled)

     

  • dwpzn Profile Picture
    3 on at

    Hi Power Apps team.

     

    Thank you this helped me solve a user to 1 site in my initial solution.

     

    I need to Filter the below so that the "Manager" (CurrentUser) and multiple sites they access (SiteName) allows them to enter 1 entry per the multiple sites they need to.

     

    The dropdown/combobox can Filter which Sites have not been captured for the current month. But also needed to know how to achieve that.

     

    If(IsEmpty(Filter('Site Security Scorecard'.Date_of_ScoreCardEntry, Month(Date_of_ScoreCardEntry) = Month(Now()))),DisplayMode.Edit,DisplayMode.Disabled)

     

    Update 1:

    I have been able to add the logic for checking IF the User and Site are for the currently logged in User/Site along with the Month logic in the below.

     

    But I think my syntax is wrong for checking the List field for Site User and Site Name. Can anyone guide me on what might be wrong with my syntax?

     

    If(
    IsBlank(
    Filter(
    'Site Security Scorecard'.Site_User = Label5_1.Text)
    )
    ), && IsBlank(
    Lookup(
    'Site Security Scorecard'.SiteName = Label6.Text
    )
    ), && IsBlank(
    Filter(
    'Site Security Scorecard'.Date_of_ScoreCardEntry,
    (Month(Date_of_ScoreCardEntry) = Month(Now()))
    )
    ),
    DisplayMode.Edit,
    DisplayMode.Disabled
    )

     

    dwpzn_1-1641384023570.png

     

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

#2
M Bilal Khan Profile Picture

M Bilal Khan 330

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard