cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
send2mark
Resolver I
Resolver I

Switch buttons based on CountRows

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.

1 ACCEPTED SOLUTION

Accepted Solutions
rubin_boer
Super User
Super User

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

 

 

View solution in original post

4 REPLIES 4
rubin_boer
Super User
Super User

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

 

 

View solution in original post

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

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

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.

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!

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (38,255)