Hi, this enduser: "" key in object has no value (p...
# advancedpdf
r
Hi, this enduser: "" key in object has no value (please refer the picture) and in advanced PDF I have "Bill to" and "end user" boxes i want to display the "end user" box if it has some value if not then just the 'bill to" box as you can see.. but its not happening, Please help i am doing this:
Copy code
<#if JSON.data.endUser?has_content>
<table style="width: 100%;">
<tr>
<th colspan="6" class="border">Bill To</th>
<th colspan="6" class="border">End User</th>
</tr>
<tr>
<td colspan="6" class="border" style="border-top:0;min-height:40px;">${JSON.data.custBillToAdd}</td>
<td colspan="6" class="border" style="border-top:0;min-height:40px;">${JSON.data.endUser}</td>
</tr>
</table>
<#else>

<table style="width: 100%;">
<tr>
<th colspan="6" class="border">Bill To</th>
<p colspan="6">&nbsp;</p>
</tr>
<tr>
<td colspan="6" class="border" style="border-top:0;min-height:40px;">${JSON.data.custBillToAdd}</td>
<p colspan="6">&nbsp;</p>
</tr>
</table></#if>
s
If endUser will always be a string, perhaps you can try:
<#if JSON.data.endUser?length gt 0>
r
@scottvonduhn it's an array
s
in the first screenshot, it's showing an empty string value for
endUser: ""
If it's really an array, there is a
?size
built-in for arrays, but the object shown suggests it's being treated as a string