pocketquery displays data filed name when a zero length value

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">
  #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>




2 answers

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. 

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)

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 13, 2019 in Marketplace Apps

Marketplace Spotlight: Marketing apps for Confluence to keep your teams working on the same page


251 views 0 6
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you