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 Apps
Answered

Attachment

(0) ShareShare
ReportReport
Posted on by 162

Good Day!
Asking for help regarding Attachments

 

ATTACHMENT.gif

 

I have LABEL and ATTACHMENT

MaxAttachment required : 1

 

LABEL : remv

Attachment Control :
ITEM : LookUp (minutes,ID = ThisItem.ID).Attachments
OnRemovedFile : Set(remv,"removed")
OnUndoRemovedFile : Set(remv,"stay");
MaxAttachments : If(Label50.Text="removed",2,If(Label50.Text="stay",1))

What I'm trying to do is 

When I delete the attachment, MaxAttachement will add a value of +1 and I can add another file.
then when I undo the file the unsaved file will be deleted and MaxAttachement will - 1.

is this possible?


thanks and advance

 

Categories:
  • Verified answer
    v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @DHAGZ ,

     

    I did a demo for you.

    Set your attachemts control's Items prroperty to:

    ThisItem.Attachments

     

    Set your default property of your attachemts control to:

    First(ThisItem.Attachments)

     

    Set MaxAttachments:

    A

     

    Set OnRemoveFile:

    Set(A,2)

    // A is the MaxAttachments

     

    Set OnUndoRemoveFile:

    Reset(DataCardValue3);Set(A,1)

    // DataCardValue3 is the attachments control's name.

     

    The result is as follows:

    AAA.gif

     

    Best Regards,

    Wearsky

     

  • DHAGZ Profile Picture
    162 on at

    Thank you @v-xiaochen-msft :).

    Keep helping and Stay safe always 🙂

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 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 204 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard