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 / Patching an attachment...
Power Apps
Answered

Patching an attachment issue

(2) ShareShare
ReportReport
Posted on by 155
Hi,
 
Can anyone help with something im hoping should be pretty simple.  Im trying to create a pdf based on a container then patch it as an attachment to the last submitted list entry but I cant get it right.
 
Set(pdffile, PDF(Signature));
SubmitForm(Safety);

Patch('Test Signature App',LookUp('Test Signature App', ID = Safety.LastSubmit.ID),{Attachments:{Value:[{'File name with extension':"signature.pdf",ContentBytes:pdffile}]}})
 
 
This is what i have but im getting this error 'The type of this argument '{Attachments}' does not match the expected type 'Table (Attachment)'. Found type 'Table'
)
 
can anyone help?
Categories:
I have the same question (0)
  • SadFox Profile Picture
    61 on at
    Attach the file using the attachment control within the Form control, and then submit the form. This should resolve the issue.
  • Suggested answer
    MS.Ragavendar Profile Picture
    7,075 Super User 2026 Season 1 on at
     
    The attachment can be patched to data-source using the power automate as well, since you haven't specified about that.
     
    Lets see other way around.
     
    Add the attachment control to the form.
     
     
    Patch
     
    Form.Updates - you have to enter the name of the form (e.g.., your form is Form1 then Form1.Updates) 
     
    I hope this helps.
     
    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
  • TBODEN Profile Picture
    155 on at
    Hi,
     
    How do i get it onto the attachment control as a valid file?
  • w.p Profile Picture
    8,345 Super User 2026 Season 1 on at
    Can you share pictures on how the PDF signature gets created?
  • TBODEN Profile Picture
    155 on at
    Im using this at the moment, with the attachement control set to attachementcollection as default item.  but i dont think its creating a valid item so it errors when trying to submit.  Signature is a container with a form and draw input.
     
     
    Set(pdffile, PDF(Signature, {ExpandContainers: true}));
    ClearCollect(
        AttachmentCollection,
        {
            Name: "signature.pdf",    
            ContentBytes: pdffile    
        }
    );
     
    SubmitForm(Safety);
  • TBODEN Profile Picture
    155 on at
    I get this error that 'id' is required within the attachment control
    Screenshot 2025-04-08 101818.png
  • w.p Profile Picture
    8,345 Super User 2026 Season 1 on at
    couldn't view your attachment
     
  • Suggested answer
    w.p Profile Picture
    8,345 Super User 2026 Season 1 on at
    do you know there is a pen control for the signature.
  • TBODEN Profile Picture
    155 on at
    yes I was using a pen control but want to pdf the container its within and then attach it to the form, i deleted it on this screenshot incase it was causing the issue
  • w.p Profile Picture
    8,345 Super User 2026 Season 1 on at
    can you show the Signature container.
     
    Do you not see any error in the formula bar for this e.g. pdffile.
    Set(pdffile, PDF(Signature, {ExpandContainers: true}));

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 899

#2
Valantis Profile Picture

Valantis 571

#3
11manish Profile Picture

11manish 499

Last 30 days Overall leaderboard