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 / Remove the last file a...
Power Apps
Unanswered

Remove the last file attached from the attachment control

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi All,

I have a situation where I need to remove the last file attached from the attachment control, if a condition returns true.

i.e.:

OnAddFile Event - > if(true,"Remove last file attached from attachment control")

Please guide.

Categories:
I have the same question (0)
  • v-yujincui-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    Maybe you could try to select the Attachments Data Card and apply the following formula on its Update property as:

    If(conditionresult=true&&CountRows(DataCardValue31.Attachments)>1,FirstN(DataCardValue31.Attachments,Sum(CountRows(DataCardValue31.Attachments),-1)),DataCardValue31.Attachments)

    When updating attachments and the number of attachments is greater than 1, this formula will not upload the last attachment to the data source.

    vyujincuimsft_0-1649321308214.png

     

    Best Regards,

    Charlie Choi

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,033

#2
Valantis Profile Picture

Valantis 632

#3
11manish Profile Picture

11manish 607

Last 30 days Overall leaderboard