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

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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Published Apr 19, 2018 in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

366 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