cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
fgtom
Frequent Visitor

Forall gallarey to output PDF of detail container.

I have a gallarey and deail container.

 

The gallarey is used to pick a project.

The deail container is used to display deails of the project you picked and the relaed data from other data sources.

 

When I use PDF function to output the container for a single project, I can output PDF with no problem.

 

But I don't know if there's a way to output PDFs for all the projects automatically.

Does anyone know if there's a way to output pfd for all the projects in the gallarey?

I first thought using Forall to iterate through the projects, but Forall doesn't accept to use Set or Update context, I even used Collect function to set variables in the detail container but it didn't work. 

1 ACCEPTED SOLUTION

Accepted Solutions
fgtom
Frequent Visitor

As a workaround, I made a while loop myself so I can change variable for every selected item.

 

This video helped me make a loop.

https://youtu.be/jQtRdvpF9F0

View solution in original post

4 REPLIES 4
v-jefferni
Community Support
Community Support

Hi @fgtom ,

 

Could you please share more details about your scenario? Would you like to generate PDF files from all items of the Gallery?

 

First of all, as in the official doc says, the PDF function allows you to select a screen or portions of a screen for export to a PDF object (blob). If you have not selected an item in the Gallery, there will be nothing or only default values within the container. The PDF function will generate a file with blanks.

 

As a workaround, you need to create a collection to include all related values from other data sources based on current Gallery item and send the collection to Power Automate flow to generate files

Clear(collection);ForAll(Gallery.AllItems, Collect(collection, {..., ..., ..., ...}))

Solved: ForAll to produce PDF pages - Power Platform Community (microsoft.com)

 

Best regards,

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

fgtom
Frequent Visitor

Thank you for trying out help me.

 

I set a specific container for PDF, which fetches data with Lookup and Filter refering to ID of selected items.

 

Because Forall doesn't accept setting Variable, I tried Last(Collect()) and Select() to pass the ID.
However, it seems Select doesn't work properly within Forall.

Hi @fgtom ,

 

The workaround I provided even not related to the container, you will not be able to get different screens or values in the container by iterating the Gallery, however, PDF function relies on the screen or container.

 

Best regards,

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

fgtom
Frequent Visitor

As a workaround, I made a while loop myself so I can change variable for every selected item.

 

This video helped me make a loop.

https://youtu.be/jQtRdvpF9F0

Helpful resources

Top Solution Authors
Top Kudoed Authors
Users online (4,239)