pocketquery displays data filed name when a zero length value

Aaran Stent May 16, 2017

I have just started using PocketQuey but and am not a Javascript coder.  I am able to get some basic templates outputing data from a MSSQL datasource and am very happy with the result.

Some of my data records have blank or null vlaues.  When this is the case I get the name of the field displayed instead of a blank field in my table.   Can someone help.  I looked through all the exmaple templates but cannot find a solution.

Here is my template....

<table class="confluenceTable">
 <tbody>
  #foreach ($row in $result)
     <tr><th class="confluenceTh">Site Code</th><td class="confluenceTd">$row.site_code</td></tr>
     <tr><th class="confluenceTh">Name</th><td class="confluenceTd">$row.site_name</td></tr>
     <tr><th class="confluenceTh">Physical Address</th><td class="confluenceTd">$row.address<br>$row.suburb&nbsp;$row.State&nbsp;$row.Postcode</td></tr>
     <tr><th class="confluenceTh">Migration Date</th><td class="confluenceTd">$row.migration</td></tr>
     <tr><th class="confluenceTh">Phone/Fax</th><td class="confluenceTd">$row.phone<br>$row.fax</td></tr>
     <tr><th class="confluenceTh">IT Contact</th><td class="confluenceTd">$row.contact_it</td></tr>
     <tr><th class="confluenceTh">Maintenance Contact</th><td class="confluenceTd">$row.contact_maintenance</td></tr>
     <tr><th class="confluenceTh">Network</th><td class="confluenceTd">$row.subnet</td></tr>
     <tr><th class="confluenceTh">Beds</th><td class="confluenceTd">$row.beds</td></tr>
     <tr><th class="confluenceTh">Users</th><td class="confluenceTd">$row.users</td></tr>
     <tr><th class="confluenceTh">Workstations</th><td class="confluenceTd">$row.workstations</td></tr>
     <tr><th class="confluenceTh">Manager</th><td class="confluenceTd">$row.contact_manager</td></tr>
#end
 </tbody>
</table>

Cheers,

Aaran

 

2 answers

0 votes
Sven Schatter _Lively Apps_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
December 11, 2017

Hey Aaran,

great to see that you solved your problem! You should probably accept your own answer so the thread gets marked as resolved. :)

As you probably already know from your other question we have moved our support to our service desk for PocketQuery.

Should you encounter any other problems with PocketQuery, please don't hesitate to raise a ticket at our service desk.

Thank you for using PocketQuery!

Best regards,
Sven (Scandio)

0 votes
Aaran Stent May 16, 2017

Ok so this is a Velocity newbie issue.  I have added the ! mark to each of my variables and now get the result I was after. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events