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

Condition on User=Author to Hide the Delete Button (Detail Screen)

Hi All,

 

I'm stuck on my Details Screen with my Delete/Remove Item Button.

I've generated my App from a SharePoint List.

From the BrowseScreen the user selects an item in the Gallery and the details of this item are displayed in the DetailsScreen.

 

On the DetailsScreen I would like to add a condition OnVisible to hide my Delete/Remove Item Button if the current user is not the one having created the concerned item.

Meaning: if the current user selects an item that he/she hasn't created, he/she cannot delete it because the Delete/Remove Item button will not be visible on the DetailsScreen.

 

I'm trying a lot of different ways, from  If(BrowseGallery1.Selected.Author.Email = User().Email,true,false) to BrowseGallery1.Selected.Author.DisplayName = User().FullName and also trying to find a workaround using Mid(User().FullName,Find(" ",User().FullName) + 1) etc.

Nothing is working: there is no error in my formula but the only results are not conclusive (everything is always either 'true' or 'false', there is no change whatever the selected item is...).

 

Would you already have encoutered this issue and have a solution?

 

Thanks,

Aladin

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Anonymous
Not applicable

Re: Condition on User=Author to Hide the Delete Button (Detail Screen)

Trying adding labels to your page to show you what each of the values you are trying to compare are in fact the same. I have experienced situations in the past when the native PowerApps User() function not actually match what the values of the user are reported at in Office 365.

For example, in Office 365 the Author.DisplayName might “Mr X” whilst the PowerApps User().FullName reports it as “X, Me”.

If you experience this, user the Office 365 Users Connector rather than User() to get the correct matching values.

Worth testing either way...
2 REPLIES 2
Highlighted
Anonymous
Not applicable

Re: Condition on User=Author to Hide the Delete Button (Detail Screen)

Trying adding labels to your page to show you what each of the values you are trying to compare are in fact the same. I have experienced situations in the past when the native PowerApps User() function not actually match what the values of the user are reported at in Office 365.

For example, in Office 365 the Author.DisplayName might “Mr X” whilst the PowerApps User().FullName reports it as “X, Me”.

If you experience this, user the Office 365 Users Connector rather than User() to get the correct matching values.

Worth testing either way...
Aladin
Level: Powered On

Re: Condition on User=Author to Hide the Delete Button (Detail Screen)

Hi o365masters,

 

Thanks a lot for your solution, it works indeed!

As you mentioned, I've tried to find workarounds to get matches between the various separators "," , " " etc. to deal with the User() function while the Office365.MyProfile() actually gives me eveything I need on the proper format.

 

Thanks again,

Aladin

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, August 21st at 8am PDT

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

SixthImage

Power Summit Australia 2019

August 20-23rd 2019

Users Online
Currently online: 18 members 4,247 guests
Please welcome our newest community members: