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 / Difficulty Generating ...
Power Apps
Answered

Difficulty Generating PDFs from Multiple Selected Items in Power Apps

(0) ShareShare
ReportReport
Posted on by 30

Hey guys,

I'm currently working on a project where I use Power Apps together with Power Automate to generate PDF documents based on selected items from a gallery.

I have a gallery where multiple items can be selected, and for the selected items, they are sent to an HtmlText: 

 

"<!DOCTYPE html>
<html>
<body>

<h2><strong>Lista itens materiais 180 dias WMO</strong></h2>

<p> </p>

<p> </p>

<p>Material: " & Gallery1_2.Selected.Quantidadeemestoque & " </p>

<p>Quantidade: " & Gallery1_2.Selected.Quantidadeemestoque0 & " " & Gallery1_2.Selected.UN & "</p>

<p>Especificações: " & Gallery1_2.Selected.Modelo_x002f_especifica_x00e7__x & " </p>

<img src=" & varimg & " style ='width:200px;height:200px'>

<p> </p>

</body>
</html>
"

 

I then trigger a Power Automate flow to generate the PDF based on the HTML content.

The problem I encounter is that the PDF is only being generated for a single item selected in the gallery, and I would need to generate it for multiple selected items. Could anyone help me with how I could do this?


Any insights, suggestions or examples on how to achieve this would be greatly appreciated. Thank you in advance for your help!

Categories:
  • pavanmanideep Profile Picture
    584 Power Up Champ - 2025 on at

    Hi @raicssa 

     

    Please refer to this..

    https://powerusers.microsoft.com/t5/Building-Power-Apps/Generate-PDF-for-multiple-gallery-items/td-p/2280878

     

    Hope this helps...

     

    If I have answered your question, please mark your post as Solved.

    If you like my response or got a direction forward to proceed, please give it a Thumbs Up. Appreciate your Kudos. You can accept more than one post as a solution.

     

    If you were still facing any issue or challenge, please do let me know so that I can try to check for you. Happy to help you further.

     

    Blog:https://ecellorscrm.com

     

    Cheers,

    PMDY

     

  • raicssa Profile Picture
    30 on at

    It came very close to working, I was able to select multiple items, send them to a collection and get the items with the concat function, but I couldn't show the images from my gallery.

    The problem I'm facing is that the image variable is being replaced with each iteration of the Concat loop, resulting in the last image being used for all items. This is my code now:

    Concat(ItensSelecionados;
     "<!DOCTYPE html>
     <html>
     <body>
     <h2><strong>Lista itens materiais 180 dias WMO</strong></h2>
     <p></p>
     <p></p>
    
    <p>Material: " & Quantidadeemestoque & "</p>
    <p>Quantidade: " & Quantidadeemestoque0 & " " & UN & "</p>
    <p>Material: " & Modelo_x002f_especifica_x00e7__x & "</p>
    <img src=" & varimg & " style ='width:200px;height:200px'>
    
    <p> </p>
    
    <body>
    <html>
    "
    )

      Can you help me?

  • Verified answer
    pavanmanideep Profile Picture
    584 Power Up Champ - 2025 on at

    Hi @raicssa ,

     

    Try this

     

    Concat(
    ItensSelecionados;
    "<!DOCTYPE html> <html> <body> <h2><strong>Lista itens materiais 180 dias WMO</strong></h2> <p></p> <p></p> <p>Material: " & Quantidadeemestoque & "</p> <p>Quantidade: " & Quantidadeemestoque0 & " " & UN & "</p> <p>Material: " & Modelo_x002f_especifica_x00e7__x & "</p> <img src='" & ThisItem.ImageURL & "' style='width:200px;height:200px'> <p> </p> </body> </html>"
    )

     

    If I have answered your question, please mark your post as Solved.

    If you like my response or got a direction forward to proceed, please give it a Thumbs Up. Appreciate your Kudos. You can accept more than one post as a solution.

     

    If you were still facing any issue or challenge, please do let me know so that I can try to check for you. Happy to help you further.

     

    Blog:https://ecellorscrm.com

     

    Cheers,

    PMDY

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 236 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 207 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 169

Last 30 days Overall leaderboard