cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AdamH
Post Patron
Post Patron

List gallery items in HTML

Hi All, 

 

I would like to list gallery items in a HTML pdf output file. 

 

I have a gallery [Gallery4] and it has a one to many relationship based on:

Filter('Staff Secondments',Ref_x0020_ID = gblSelectedEmployee.ID)

 

So i would like to display all the filtered items in my HTML form - Any ideas how to achieve this? 

1 ACCEPTED SOLUTION

Accepted Solutions
cwebb365
Solution Sage
Solution Sage

I do this to create html email reports. You utilize a html text control, plug in the HTML and you can utilize things like this concat( filter, for your gallery items source, and then use the fields and encompassing html to have it build out a list in a table. Here is an example section of a table in one of my e-mail I sent out for our Benefits enrollment listing in a table primary beneficiaries inside html text control that is used in an send e-mail connector. The stuff surrounded by &'s is the columns from the datasource.

 

In your case you would use that if it's e-mail or send it via flow or something to wherever it needs to go. 

 

<tr>" & Concat(
PrimaryBeneficiaries,
"
<td style=""width: 111.05pt; border-top: none; border-left: solid white 2.25pt; border-bottom: solid white 2.25pt; border-right: solid white 2.25pt; padding: 1.45pt 5.4pt 1.45pt 5.4pt;"" width=""148"">
" & FirstName & " " & LastName & "
</td>
<td style=""width: 50pt; border-top: none; border-left: solid white 2.25pt; border-bottom: solid white 2.25pt; background: #F2F2F2; border-right: solid white 2.25pt; padding: 1.45pt 5.4pt 1.45pt 5.4pt;"" >
Primary
</td>
<td style=""width: 150.65pt; border-top: none; border-left: none; border-bottom: solid white 2.25pt; border-right: solid white 2.25pt; background: #F2F2F2; padding: 1.45pt 5.4pt 1.45pt 5.4pt;"" width=""413"">
<p style=""margin: 1.0pt 0in 1.0pt 0in;"">" & Relationship & "</p>
</td>
<td style=""width: 70.45pt; border: none; border-bottom: solid white 2.25pt; background: #009FDF; padding: 1.45pt 5.4pt 1.45pt 5.4pt;"" width=""94"">
<p style=""margin: 1.0pt 0in 1.0pt 0in;""><strong><span style=""color: white;"">" & Percent & "</span></strong></p>
</td>
</tr>

 

 

 

But essentially this is "Looping" using concat, which builds the HTML entries for each item in the datasource. 

View solution in original post

2 REPLIES 2
cwebb365
Solution Sage
Solution Sage

I do this to create html email reports. You utilize a html text control, plug in the HTML and you can utilize things like this concat( filter, for your gallery items source, and then use the fields and encompassing html to have it build out a list in a table. Here is an example section of a table in one of my e-mail I sent out for our Benefits enrollment listing in a table primary beneficiaries inside html text control that is used in an send e-mail connector. The stuff surrounded by &'s is the columns from the datasource.

 

In your case you would use that if it's e-mail or send it via flow or something to wherever it needs to go. 

 

<tr>" & Concat(
PrimaryBeneficiaries,
"
<td style=""width: 111.05pt; border-top: none; border-left: solid white 2.25pt; border-bottom: solid white 2.25pt; border-right: solid white 2.25pt; padding: 1.45pt 5.4pt 1.45pt 5.4pt;"" width=""148"">
" & FirstName & " " & LastName & "
</td>
<td style=""width: 50pt; border-top: none; border-left: solid white 2.25pt; border-bottom: solid white 2.25pt; background: #F2F2F2; border-right: solid white 2.25pt; padding: 1.45pt 5.4pt 1.45pt 5.4pt;"" >
Primary
</td>
<td style=""width: 150.65pt; border-top: none; border-left: none; border-bottom: solid white 2.25pt; border-right: solid white 2.25pt; background: #F2F2F2; padding: 1.45pt 5.4pt 1.45pt 5.4pt;"" width=""413"">
<p style=""margin: 1.0pt 0in 1.0pt 0in;"">" & Relationship & "</p>
</td>
<td style=""width: 70.45pt; border: none; border-bottom: solid white 2.25pt; background: #009FDF; padding: 1.45pt 5.4pt 1.45pt 5.4pt;"" width=""94"">
<p style=""margin: 1.0pt 0in 1.0pt 0in;""><strong><span style=""color: white;"">" & Percent & "</span></strong></p>
</td>
</tr>

 

 

 

But essentially this is "Looping" using concat, which builds the HTML entries for each item in the datasource. 

View solution in original post

AdamH
Post Patron
Post Patron

@cwebb365 

 

Thanks for that. I managed to put this together for my PDF output and it worked out well. 

 

<h3><span style='color: #333399;'>Secondments</span></h3>
<table style='border-collapse: collapse; width: 100%;' border='1'>
<tbody>
<tr>
<td style='width: 100%;'>" & Concat(Gallery4.AllItems, 'Seconded Start' & " - " & 'Secondment Finish' & " - " & 'Seconded Line' & " - " & 'Seconded to'.Value & "<br>") & "</td>
</tr>
</tbody>
</table>

 

Helpful resources

Announcements
User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,548)