cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
anonymia25
Helper III
Helper III

Button visibility based on conditions

Hello, 

I am trying to combine the visibility of my button based on active tabs and current user email. Below is my formula in Button Visible:

varTab = "Details" And
If(displayItem.Status.Value = "Open" || displayItem.Status.Value = "Pending",  displayItem.PIC.Email = CurrentUserProfile.Email, true, false)


OnSelect formula for the tab button:

Set(varTab, "Details")


There is no error but it seems the button is not displaying based on the condition stated. Appreciate the help on what I can do to solve this. Thanks!

6 REPLIES 6
C-Papa
Super User
Super User

have you tried putting varTab = "Details" And inside the if statement, at the minute its sitting outside. 

 

If(And(varTab = "Details",displayItem.PIC.Email = CurrentUserProfile.Email,Or(displayItem.Status.Value = "Open", displayItem.Status.Value = "Pending")), true, false)

@anonymia25 

If() functions are not usually necessary in Visibility since the conditions will reduce to either true or false when the logic is properly constructed.

 

Hi @C-Papa ,
i tried this way but the button seems to not show up at all..

@Drrickryp 
thank you for the clarification. how do you suggest i approach this matter? as i have created two button one to display when the status is "open" or "pending" which will be shown for PIC. While the other button will be displayed for the requestor when the status is "resolved"..

Chitrakant27
Advocate I
Advocate I

Hi,@anonymia25 

 

Kindly try this formula onVisible of button

If(displayItem.Status.Value = "Open" || displayItem.Status.Value = "Pending",  displayItem.PIC.Email = CurrentUserProfile.Email, varTab=true, varTab=false)

 And apply onSelect formula in Tabbutton(means whatever your button name)

 

If(Tabbutton.Pressed,true);set(varTab,"Details")

 

Thanks,

Chitrakant27

sorry apply this formula on Tab Button

And apply the onSelect formula in Tabbutton(means whatever your button name)

 

If(Tabbutton.Pressed,true);set(varTab,true)

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,256)