Skip to main content

Notifications

Power Apps - Power Apps Pro Dev & ISV
Answered

Auto fill attachment card of form with pdf file

Posted on 13 Dec 2024 00:40:23 by 3
Hello I try to automate my form, and want to have a pdf file automatically inserted into the form - attachment card.
 
 
I generate the pdf with Set(pdfBlob; PDF(FROMFORM; {ExpandContainers: true}))
 
and add it to the attachment card with
 
 
After trying to submit the Form the issues occures field "id" is required
 
 
How can I set the field id in this case?
 
 
Just for information if I manually upload a file by adding a attachment the submitform success so I guess I have to set some value to the automatically added file ?
  • Suggested answer
    JM-13120031-0 Profile Picture
    JM-13120031-0 3 on 14 Dec 2024 at 11:10:20
    Auto fill attachment card of form with pdf file
    Hi @WarrenBelz thanks for your help, jfyi you don't need triggerbody to add for file name ;) 
  • Verified answer
    WarrenBelz Profile Picture
    WarrenBelz 143,595 on 14 Dec 2024 at 06:46:30
    Auto fill attachment card of form with pdf file
    The issue is that the output of the PDF function is incompatible with that expected by an Attachment control and there is no way of converting this is Power Apps. You need a Flow like this
    and the run code sending the ID of the target record (where indicated)
    With(
       {
          _File: 
          PDF(
             FROMFORM; 
             {ExpandContainers: true}
          )
       };
       YourFlowName.Run(
          YourIDHere;
          {
             file: 
             {
                contentBytes: _File;
                name: "Test.pdf"
             }
          }
       )
    )
     
    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    Buy me a coffee

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,595

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,098

Leaderboard