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 / Switch buttons based o...
Power Apps
Answered

Switch buttons based on CountRows

(0) ShareShare
ReportReport
Posted on by 505

I have the following used to count down the number of available seats for a class and I want to change the "Join" button to "full" when it gets to Zero.

 

"Available seats : " & 12 - CountRows(
Filter(
Event1, 'Event Session'="Course 1"
)
)

 

Event1 is the SharePoint list

Event Session is a Text field with "Course 1" entered.

Categories:
I have the same question (0)
  • Verified answer
    rubin_boer Profile Picture
    4,843 Super User 2024 Season 1 on at

    hi @send2mark you can set the Buttons Text with a conditional statement and display the text based on the evaluation.

     

    Text = If(CountRows(Filter(Event1, 'Event Session'="Course 1")) = 0 , "Full","Join")

     

    Hope it helps

     

     
  • send2mark Profile Picture
    505 on at

    If I was trying to hide the button, is this close?

    Visible=If(CountRows(Filter(Event1, 'Event Session'="Course 1")) = 0 , false, true)

  • send2mark Profile Picture
    505 on at

    Actually, I tried using your with Text and it will not deviate from Join. I cannot get it to switch to Full even though it is at 0.

  • send2mark Profile Picture
    505 on at

    oh man I am sorry. So I had two buttons. The full button did not have any code. So what happened is that it was sitting above join. All I had to do was change the order. 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 534

#2
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 306

Last 30 days Overall leaderboard