
Announcements
Hello everyone,
I'm trying to make a pdf using the html text control and html syntax. There's a part where I would like to include the attachments that form part of the sharepoint list item and this is where I have issues. The AbsoluteUri path that is generated from the attachments gives me a "can't reach this page" error when I click on the link generated. Then I noticed that the link of the sharepoint list item attachment is not exactly the same as the one the AbsoluteUri gives me, it appears to be abridged...
For example I get this from the powerapps AbsoluteUri
https://example.sharepoint.com/sites/PaymentVoucher/Lists/Vouchers/Attachments/63/WhatsApp
Instead of
https://example.sharepoint.com/sites/PaymentVoucher/Lists/Vouchers/Attachments/63/WhatsApp%20Image%202023-11-21%20at%2011.38.18_3e273065.jpg
Is there a way I can solve this problem?
This is my full html formula...
"<!DOCTYPE html>
<html style='background-image: url(" & varLogo & "); opacity: 0.6;'>
<body>
<div style='background-color:white;color:#5a5a5a;padding:20px;'>
<img src=" & varLogo & " style ='width:170px;height:70px'>
<h2 style='text-align:center; font-family:verdana;'>Expenditure Requisition</h2>
<hr>
<p style = 'font-family:verdana'><b>Date:</b> " & Text(
dat_Reports_VoucherTable.Selected.Created,
"d/m/yyyy"
) & "</p>
<p style = 'font-family:verdana'><b>Initiating Officer:</b> " & dat_Reports_VoucherTable.Selected.'Created By'.DisplayName & "</p>
<p style = 'font-family:verdana'><b>Department:</b> " & dat_Reports_VoucherTable.Selected.Department.Value & "</p>
<p style = 'font-family:verdana'><b>Unit:</b> " & dat_Reports_VoucherTable.Selected.Unit.Value & "</p>
<p style = 'font-family:verdana'><b>Vendor:</b> " & dat_Reports_VoucherTable.Selected.Vendor & "</p>
<p style='white-space: pre-wrap; word-break: keep-all; font-family:verdana;'><b>Description:</b> " & dat_Reports_VoucherTable.Selected.Description & "</p>
<br><h2 style='text-align:center; font-family:verdana;'>Budget Details</h2>
<hr>
<p style = 'font-family:verdana'><b>Budget Code:</b> " & dat_Reports_VoucherTable.Selected.BudgetCode & "</p>
<p style = 'font-family:verdana'><b>Amount Requested:</b> " & Text(
dat_Reports_VoucherTable.Selected.AmountRequested,
"₦#,###.00"
) & "</p>
<p style = 'font-family:verdana'><b>New Budget Balance:</b> " & Text(
varPdfBudgetBalance,
"₦#,###.00"
) & "</p>
<p style = 'font-family:verdana'><b>Budget Cleared By:</b> " & dat_Reports_VoucherTable.Selected.BudgetClearedBy.DisplayName & "</p>
<p style = 'font-family:verdana'><b>Budget Cleared Date:</b> " & dat_Reports_VoucherTable.Selected.BudgetClearedTime & "</p>
<br><h2 style='text-align:center; font-family:verdana;'>Approval Status - "&dat_Reports_VoucherTable.Selected.ApprovalStatus &"</h2>
<hr>
<table style='width:100%; font-family:verdana;'>
<tr>
<th style= 'padding-bottom: 10px; text-align:left'>First Approver</th>
<th style= 'padding-bottom: 10px; text-align:left'>Second Approver</th>
<th style= 'padding-bottom: 10px; text-align:left'>Third Approver</th>
</tr>
<tr>
<td>" & dat_Reports_VoucherTable.Selected.FirstApprover.DisplayName & "</td>
<td>" & dat_Reports_VoucherTable.Selected.SecondApprover.DisplayName & "</td>
<td>" & varPdfThirdApprover & "</td>
</tr>
<tr>
<td>" & dat_Reports_VoucherTable.Selected.FirstApprovalTime & "</td>
<td>" & dat_Reports_VoucherTable.Selected.SecondApprovalTime & "</td>
<td>" & varPdfThirdApproverTime & "</td>
</tr>
</table>
<br><br><h2 style='text-align:center; font-family:verdana;'>Attachments</h2>
<hr>
"& Concat(dat_Reports_VoucherTable.Selected.Attachments,"<br><br><a href="& AbsoluteUri &">"& DisplayName &"</a>")&"
<br><br><footer>
<pre style='font-size:80%;'>Generated By: " & User().FullName & " " & Text(
Now(),
"d/m/yyyy hh:mm AM/PM"
) & "</pre>
</footer>
</div>
</body>
</html>" Hi @AdaEloka ,
Depending on where are using that, the URL resolution may stop at the first space (in the name in this case). You can try
. . . . . " &
Concat(
dat_Reports_VoucherTable.Selected.Attachments,
"<br><br><a href='" &
Substitute(
AbsoluteUri
" ",
"%20"
) &
"'>" & DisplayName & "</a>"
) & " . . . . . .
and see if that works for you.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
MVP (Business Applications) Visit my blog Practical Power Apps