cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
CraigFeg
Level: Powered On

Showing & Hiding A Button

Hi,

 

I currently have a button which is 'Line Manager' and I also have a form in which a 'Line Manager' field is present and linked to a SharePoint list. Within this list I have defined Line Manager as a person field and therefore it has O365 credentials such as email etc linked to it. 

 

I am trying to only show to button on the form if the line manager views the form and when an employee accesses the form it will be hidden.

 

This is my current setup:

 

Line Manager Button Visible Value:

 

Line Manager Button Visible Field.JPG

 

Line Manager Data Card Values:

 

Line Manager DataCard Values.JPG

 

*Note - Currently, the button is hidden even with the current user (me) and the Line Manager field equal to me.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Showing & Hiding A Button

Hi @CraigFeg,

 

Please first check if the person field is Multi-value enabled, if Multi-value enabled, then it is not available to work with '='.

For single value person field, please change the AccessibleLabel property of the Lookup control to:

ThisItem.SinglePersonField.Email

See if this would help.

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
Meneghino
Level 10

Re: Showing & Hiding A Button

Two things come to mind:

1) String comparison may be case sensitive, so you could try the Lower() function on both sides

2) There may be performance lag issues with the User() function that can be resolved thus

Super User
Super User

Re: Showing & Hiding A Button

I believe the issue is with the visible property.

 

Try this:

If(DataCardValue5.Selected.Email = User().Email, true, false)


--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
Community Support Team
Community Support Team

Re: Showing & Hiding A Button

Hi @CraigFeg,

 

Please first check if the person field is Multi-value enabled, if Multi-value enabled, then it is not available to work with '='.

For single value person field, please change the AccessibleLabel property of the Lookup control to:

ThisItem.SinglePersonField.Email

See if this would help.

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

CraigFeg
Level: Powered On

Re: Showing & Hiding A Button

@v-micsh-msft@Jeff_Thorpe@Meneghino

Hi All,

I've tried all solutions you have suggested with no luck! My current situation is shown below. Can any of you suggest any fix to show the button?

 

Start Screen: Assigning the User() to CurrentUser as suggested above

 

Start Screen Setting User.JPG

 

Button Visible Property

 

Button Visible Property.JPG

 

 

 

LineManager field properties

 

LineManager Datacard Value Details.JPG

 

 

If anyone could help ASAP that would be great! have to demo this app in the very near future and cant resolve this 😞

 

Thanks

 

Craig

CraigFeg
Level: Powered On

Re: Showing & Hiding A Button

Just an update. I have done a test and added two text labels on the home screen (one to show line manager and one to show current user). Both are different even when the line manager field email i know is the same as the current user (me). So therefore, I think the line manager field is not dynamically updating when the app is launched. 

 

Any ideas?

CraigFeg
Level: Powered On

Re: Showing & Hiding A Button

Sorry - Fixed this issue now. Solution has been accepted.

 

Many thanks!

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (5,159)