cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kouliscon
Helper V
Helper V

Attachment - remove the attachment only if it was created by myself or only an admin can remove them

Hello,

 

i am trying to find a solution at my canvas attachments that the user who has uploaded the attachment to be able to remove them and/ or an administrator.

 

let me know if that is possible.

 

thank you

6 REPLIES 6
WarrenBelz
Super User
Super User

Hi @kouliscon ,

SharePoint does not record which user created an attachment, only who created or last edited the record.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

 

WarrenBelz
Super User
Super User

Hi @kouliscon ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

thank you @WarrenBelz 

 

waht i found after researching at the internet is that i can remove the possibility to delete and already uploaded attachments by going to the datacardValue of the attachment at the "OnRemoveFile" and put: Reset(Self). Then the remove file will be disabled but i am looking for a solution someone like an administrator to still have the possibility to remove them...

 

let me know pls

Hi @kouliscon ,

You would just need to set a Variable for the Administrator then OnRemoveFile

If(
   !IsAdmin,
   Reset(Self)
)

To set, have a reference list with email and role of staff and at App OnStart

Set(
   IsAdmin,
   LookUp(
      YourRefList,
      YourEmailField = User().Email
   ).Role = "Admin"
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

 

thank you

 

i have created a list named:  "summer associate attachements" and then i added two columns:

 

1) people/ person with the email address

2) role

 

i made an entry with my email address and role Admin.

 

i then went at the App OnStart and i added what you mention what you wrote above but there i already have

 

If(!IsBlank(Param("ID")),Set(varID, Param("ID"));Navigate(Screen1,ScreenTransition.Fade));

 

how can i combine them?

 

 

And (Set(IsAdmin,LookUp('Summer Associate Attachments',Email = User().Email).Role = "Admin")

Hi @kouliscon ,

You do not need to combine them - just run the Variable setup first. Also if that is a Person column (you really do not need one for this), you would need

Set(
   IsAdmin,
   LookUp(
      'Summer Associate Attachments',
      YourPersonColumn.Email = User().Email
   ).Role = "Admin"
);
If(
   !IsBlank(Param("ID")),
   Set(
      varID, 
      Value(Param("ID"))
   );
   Navigate(
      Screen1,
      ScreenTransition.Fade
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Check out the New Ideas Site

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (4,970)