cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
lolla70
Helper IV
Helper IV

Switch Colors is not working!

I have the below buttons and I want the employee to pick where they are working from each week and when I click the button in not selected
OnFill Code

Switch(lblDay.Text,"Monday",
If(
First('Back to Work Schedule').'Monday Location' = ThisItem.Name,
varAccent,
varPrimary
), "Tuesday", If(
First('Back to Work Schedule').'Tuesday Location' = ThisItem.Name,
varAccent,
varPrimary
),
"Wednesday", If(
First('Back to Work Schedule').'Wednesday Location' = ThisItem.Name,
varAccent,
varPrimary
),
"Thursday", If(
First('Back to Work Schedule').'Thursday Location' = ThisItem.Name,
varAccent,
varPrimary
),
"Friday", If(
First('Back to Work Schedule').'Friday Location' = ThisItem.Name,
varAccent,
varPrimary
),
"Saturday", If(
First('Back to Work Schedule').'Saturday Location' = ThisItem.Name,
varAccent,
varPrimary
),
"Sunday", If(
First('Back to Work Schedule').'Sunday Location' = ThisItem.Name,
varAccent,
varPrimary
)
)

lolla70_0-1613671205788.png

OnSelect Code

Patch(
'Back to Work Schedule',
First(
Filter(
'Back to Work Schedule',
User().Email=VarUserEmail1
)
),

Switch(lblDay.Text,"Monday",
{'Monday Location': ThisItem.Name}
, "Tuesday",
{'Tuesday Location': ThisItem.Name}
, "Wednesday",
{'Wednesday Location': ThisItem.Name}
, "Thursday",
{'Thursday Location': ThisItem.Name}
, "Friday",
{'Friday Location': ThisItem.Name}
, "Saturday",
{'Saturday Location': ThisItem.Name}
, "Sunday",
{'Sunday Location': ThisItem.Name}

)

)
Any Help!

10 REPLIES 10
lolla70
Helper IV
Helper IV

One more thing please, how to reset the button after send confirmation. 

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (3,078)