web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / sharepoint integrated ...
Power Apps
Unanswered

sharepoint integrated powerapp attached deleted files are reappears or populating again while submitting the sharepointform

(0) ShareShare
ReportReport
Posted on by 4

Dear Experts , 

I have an issue while deleting power app attachment. please see below and help 

Issue:
When attempting to delete a file from the attachment control in a Power App integrated with SharePoint, the deleted file reappears after saving the form.

Collection: colattachments

SharePoint List: 'India Contract Approval List'
Attachmentdatacard: DataCardValue28

App Initialization: OnStart:
ClearCollect(
colattachments,
Defaults('India Contract Approval List').Attachments
);
Refresh(Defaults('India Contract Approval List').Attachments);

SharePoint Integration
: OnEdit and OnView:
If(
CountRows(colattachments) = 0,
SharePointIntegration.Selected.Attachments,
colattachments
);

Screen Visibility: OnVisible property:

Refresh('India Contract Approval List');
Refresh(Defaults('India Contract Approval List').Attachments);
ClearCollect(colattachments, DataCardValue28.Attachments);

Attachment Update Property:

DataCardValue28.Attachments


On Add File  (this File tagging with reference with @RezaDorrani)
ClearCollect(
colattachments,
DataCardValue28.Attachments
);
UpdateIf(
colattachments,
!(First(Split(DisplayName, "-")).Value in colattachmentTags),
{
Name: drpAttchtag.Selected.Value & "-" & Name,
DisplayName: drpAttchtag.Selected.Value & "-" & DisplayName
}
);


OnRemove Property:

ClearCollect(colattachments, ThisItem.Attachments)

Attachment Item property - this has referred from @WarrenBelz's advice

If(CountRows(colattachments)=0, ThisItem.Attachments,colattachments)

OnSave Action:

ClearCollect(colattachments, DataCardValue28.Attachments);
SubmitForm(SharePointForm1);


How to Modify the setup to ensure that deleted files are permanently removed from the attachment control and do not reappear after saving the form.

Categories:
  • cchannon Profile Picture
    4,702 Moderator on at

    Moving your post to the Building Power Apps forum where you will get better and faster answers to your PowerFx Questions...

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 397 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 354

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard