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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Creating multiple pdf'...
Power Apps
Answered

Creating multiple pdf's in one action

(0) ShareShare
ReportReport
Posted on by
Hi All,
 
I'm struggling to figure out how I can complete this requirement, so I'd appreciate any suggestions or advice.
 
I have an app that produces certificates of cover for properties that are covered under an insurance policy. One of the current features is being able to select a property from a gallery, and download a certificate for that property. An additional requirement is to be able to get certificates for all properties within the list at once.
 
Here is the existing process for downloading a single certificate:
 
1. User selects the required property from the gallery list which creates a single row collection
2. the fields in the collection populate a container that is the certificate template
3. the container is passed to a flow via the PDF function
4. the flow creates and saves the pdf in a designated folder and also returns the same doc to the power app
5. the file automatically downloads for the user using the download function
 
I need a similar process that creates a document for the entire list with a few changes as follows
 
1. User selects the "select all" option which creates a collection containing multiple rows
2. each data row is passed through the container template and captured as pdf to be passed to a flow
3. the container is passed to a flow via the PDF function for each row
4. the flow creates a new sub folder within the existing designated folder
5. the flow creates and saves a pdf for each data row in the sub folder
5. the flow triggers an email to the user including a link to the folder
 
I'm open to amending the current function & flow to achieve this or creating something completely different. Having done some testing, I'm able to create a new folder and create a single pdf within that (which is the first row of the collection) and return the confirmation email to the user, but I can't figure out how to do the same for all rows. 
 
The existing code and flow are included here, and let me know if any questions or more info needed.
 
On select of download button:
Download(
CoCDev_existing_createPDF.Run(
    tab_insured.Selected.Value &" ISR CoC " & Now(),
    {
        file: {
            name: "test.pdf",
            contentBytes: PDF(ctn_cert_pol_CGL,
            {
            Orientation: PaperOrientation.Portrait,
            Size: PaperSize.A4,
            Margin: "50px 25px 120px 25px",
            ExpandContainers: true,
            DPI: 50
        })
        }
    }
).path);
 
Flow referenced in function:
Categories:
I have the same question (0)
  • Verified answer
    Ravindra Jadhav Profile Picture
    342 Moderator on at
    Hii,
     
    can you try like this
     
    ClearCollect(
        colPDFPaths, 
        ForAll(
            Gallery1.AllItems,
            {
                FilePath: Download(
                    CoCDev_existing_createPDF.Run(
                        ThisRecord.tab_insured.Selected.Value & " ISR CoC " & Now(),
                        {
                            file: {
                                name: "test.pdf",
                                contentBytes: PDF(
                                    ctn_cert_pol_CGL,
                                    {
                                        Orientation: PaperOrientation.Portrait,
                                        Size: PaperSize.A4,
                                        Margin: "50px 25px 120px 25px",
                                        ExpandContainers: true,
                                        DPI: 50
                                    }
                                )
                            }
                        }
                    ).path
                )
            }
        )
    );
    
     
     
    Please Closed the Question, Mark it Solved 
     
    If my answer helped resolve your issue, please consider marking it as solved to assist others facing the same problem. Additionally, giving it a like would be greatly appreciated and motivates us to keep helping
     
    Thank You
    Ravindra Jadhav

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard