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
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
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 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 @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 ,
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
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
146,651
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,999
Most Valuable Professional