cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rsinha
Helper I
Helper I

Delete record option should be enable for the respective person

Hi Folks,
I am creating an app: "Seat availability at Office" where people can submit their request to come to office date wise as well location wise. Due to this pandemic, we are restricting that only 100 employees can come to office per day (again location-wise).

Backend: SP list

I am accessing the data in Gallery, and it looks like this:

 

rsinha_0-1627359480975.png

 

Now requirement is to give a Delete record option, but it should be available for the respective user who has logged-in.

Like in this case, If I, Rachit Sinha accessing the app, so delete record option should be there against my record only, not with other user records.

Here employee name is Person type field in Sharepoint List.

Kindly suggest how to achieve this.

 

Many thanks!

2 ACCEPTED SOLUTIONS

Accepted Solutions
StalinPonnusamy
Community Champion
Community Champion

Can you validate what value you are getting from both functions?

 

User().FullName

StalinPonnusamy_0-1627361178100.png

And Office365Users.MyProfile().DisplayName

StalinPonnusamy_1-1627361200793.png

 

Another option to use User().Email to get Office365Users

View solution in original post

Got it, thank you for the help  @StalinPonnusamy  

It's working now..

 

View solution in original post

6 REPLIES 6
StalinPonnusamy
Community Champion
Community Champion

Hi @rsinha 

We can hide the delete button. Set the visible property for the Delete button/Icon

 

 

User().FullName=BrowseGallery1.Selected.'Requested For'.DisplayName

 

 

  'Requested For' - Person in SP list to whom it requested

 

StalinPonnusamy_0-1627360282601.png

 

Note: We can also use Office365Users.MyProfile().DisplayName to get user information

Hi @StalinPonnusamy 

Thank you for the help, I am one step away for solution.

When I write following code for Visible property: 

User().FullName = Gallery5.Selected.'Emplyee Name'.DisplayName

It doesn't show for me either.

 

rsinha_0-1627360796471.png

 

And when I chose: Office365Users.MyProfile().DisplayName

It is visible for all user records.

StalinPonnusamy
Community Champion
Community Champion

Can you validate what value you are getting from both functions?

 

User().FullName

StalinPonnusamy_0-1627361178100.png

And Office365Users.MyProfile().DisplayName

StalinPonnusamy_1-1627361200793.png

 

Another option to use User().Email to get Office365Users

View solution in original post

Got it, thank you for the help  @StalinPonnusamy  

It's working now..

 

View solution in original post

StalinPonnusamy
Community Champion
Community Champion

Hi @rsinha 

 

Please validate what value you are getting for

Office365Users.MyProfile().UserPrincipalName

 

Ideally, we are trying to see how profile set it up and what field is best option to use

StalinPonnusamy
Community Champion
Community Champion

Thanks @rsinha for the confirmation.

 

Please do not forget to Accept it as a solution if works fine to help other users to find it useful.

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 (1,652)