Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

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

(0) ShareShare
ReportReport
Posted on by 247

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

  • WarrenBelz Profile Picture
    146,651 Most Valuable Professional on at
    Re: Attachment - remove the attachment only if it was created by myself or only an admin can remove them

    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

  • kouliscon Profile Picture
    247 on at
    Re: Attachment - remove the attachment only if it was created by myself or only an admin can remove them

    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")

  • WarrenBelz Profile Picture
    146,651 Most Valuable Professional on at
    Re: Attachment - remove the attachment only if it was created by myself or only an admin can remove them

    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

     

  • kouliscon Profile Picture
    247 on at
    Re: Attachment - remove the attachment only if it was created by myself or only an admin can remove them

    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

  • WarrenBelz Profile Picture
    146,651 Most Valuable Professional on at
    Re: Attachment - remove the attachment only if it was created by myself or only an admin can remove them

    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

  • WarrenBelz Profile Picture
    146,651 Most Valuable Professional on at
    Re: Attachment - remove the attachment only if it was created by myself or only an admin can remove them

    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

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,651 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard