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: