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

This widget could not be displayed.

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. 

This widget could not be displayed.

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 Aug 22, 2018 in Marketplace Apps

How a Marketplace app tech team is achieving gender diversity

Hello! My name is Genevieve Blanch, and I'm the Marketing Manager at RefinedWiki, creators of apps to give teams the tools to customize Atlassian platforms. Currently, 44% of the tech team at Re...

523 views 3 19
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