Pocket Query zeigt HTML als plaintext an.
Asked by Stephan Mallmann:

Hallo Atlassian Team,

ich habe ein Problem mit der Darstellung eines SQL Querys ?ber das Plugin Pocket Query im Confluence.  

Das Query zeigt eine mehrzeilige Spalte als HTML Text an und das nicht formatiert. Wei? leider nicht was ich noch tun soll.

### SQL Statement: {#toc-hId-1158137852}

SELECT

j5.isys_purpose__title AS 'Einsatzzweck',

j1.isys_sla_service_level__title AS 'SLA Service Level',

j2.isys_catg_sla_list__reaction_time AS 'Reaktionszeit',

j2.isys_catg_sla_list__recovery_time AS 'Wiederherstellungszeit',

j2.isys_catg_sla_list__description AS 'Beschreibung'

FROM isys_obj AS obj_main

INNER JOIN isys_cmdb_status AS obj_main_status ON obj_main_status.isys_cmdb_status__id = obj_main.isys_obj__isys_cmdb_status__id

LEFT JOIN isys_catg_sla_list AS j2 ON j2.isys_catg_sla_list__isys_obj__id = obj_main.isys_obj__id

LEFT JOIN isys_sla_service_level AS j1 ON j1.isys_sla_service_level__id = j2.isys_catg_sla_list__isys_sla_service_level__id

LEFT JOIN isys_catg_global_list AS j6 ON j6.isys_catg_global_list__isys_obj__id = obj_main.isys_obj__id

LEFT JOIN isys_purpose AS j5 ON j5.isys_purpose__id = j6.isys_catg_global_list__isys_purpose__id

LEFT JOIN isys_obj_type AS j9 ON j9.isys_obj_type__id = obj_main.isys_obj__isys_obj_type__id

WHERE TRUE

AND ( (j9.isys_obj_type__id = '45' )) AND ( (obj_main.isys_obj__title = 'Mailoptimizer' )) ORDER BY obj_main.isys_obj__id ASC;

### Ausgabe IST: {#toc-hId-2045641533}

|         Einsatzzweck         | SLA Service Level | Reaktionszeit | Wiederherstellungszeit |                                                        Beschreibung                                                        |
|------------------------------|-------------------|---------------|------------------------|----------------------------------------------------------------------------------------------------------------------------|
| Produktion + Demo + Referenz | 98%               | 1             | 24                     | \<p\>Verf\&uuml;gbarkeit pro Quartal.\</p\> \<p\>Reaktions- und Behebungszeit f\&uuml;r \&quot;critical\&quot; F\&auml;lle |

### Ausgabe SOLL: {#toc-hId--1361822082}

|         Einsatzzweck         | SLA Service Level | Reaktionszeit | Wiederherstellungszeit |                                Beschreibung                                |
|------------------------------|-------------------|---------------|------------------------|----------------------------------------------------------------------------|
| Produktion + Demo + Referenz | 98%               | 1             | 24                     | Verf?gbarkeit pro Quartal. Reaktions- und Behebungszeit f?r critical F?lle |

?ber eure Hilfe w?re ich sehr froh.

Mit freundlichen Gr??en,

Stephan Mallmann


Answers:
author: Felix Grund (Scandio)
body: Hi Stephan,

Thank you for your interest in PocketQuery! Can you please try if it works if you create the below custom template and assign it to your query? Please let me know the result.

```
&lt;table class="aui confluenceTable pocketquery-table"&gt;	&lt;thead&gt;		&lt;tr&gt;		#foreach ($column in $columns)			&lt;th class="col-$velocityCount"&gt;$!column&lt;/th&gt;		#end		&lt;/tr&gt;	&lt;/thead&gt;		&lt;tbody&gt;		#foreach ($row in $result)			&lt;tr class="#if($velocityCount % 2 != 0)odd#{else}even#end"&gt;			#foreach ($column in $row)				#set($pqTextWithHtml = false)				#set($pqTextWithHtml = $!column)				&lt;td class="col-$velocityCount"&gt;$pqTextWithHtml&lt;/td&gt;			#end			&lt;/tr&gt;		#end	&lt;/tbody&gt;&lt;/table&gt;
```

Regards, Felix (Scandio)


author: Stephan Mallmann
body: Hello again,

i used your template in Jun. and it works very well.  
But now i have the problem that the table looks like this.

| Service | Einsatzzweck | Servicelevel | Reaktionszeit | Wiederherstellungszeit | Montag | Dienstag | Mittwoch | Donnerstag | Freitag | Samstag | Sonntag | Beschreibung |
|---------|--------------|--------------|---------------|------------------------|--------|----------|----------|------------|---------|---------|---------|--------------|

|--------------------------|------------------------------------|------------------------------------|------------------------------------|------------------------------------|------------------------------------|------------------------------------|------------------------------------|------------------------------------|------------------------------------|------------------------------------|------------------------------------|------------------------------------|
| Abit Scoring             | Produktion + Test                  | 98,5%                              | 0                                  | 0                                  | \[B@1e353b9d                       | \[B@38dccfe9                       | \[B@28d5e729                       | \[B@733b49b0                       | \[B@3962fcea                       | \[B@11ca8415                       | \[B@6a587d3                        |                                    |
| BraFo                    | Produktion + Test                  | Produktion + Test                  | 0                                  | 0                                  | \[B@1a34f8b8                       | \[B@bb50579                        | \[B@197a50f0                       | \[B@2d57c9a1                       | \[B@5e768048                       | \[B@35e0276b                       | \[B@f3bfd6f                        |                                    |
| Configuration Management | LC__CMDB__CATG__PURPOSE_PRODUCTION | LC__CMDB__CATG__PURPOSE_PRODUCTION | LC__CMDB__CATG__PURPOSE_PRODUCTION | LC__CMDB__CATG__PURPOSE_PRODUCTION | LC__CMDB__CATG__PURPOSE_PRODUCTION | LC__CMDB__CATG__PURPOSE_PRODUCTION | LC__CMDB__CATG__PURPOSE_PRODUCTION | LC__CMDB__CATG__PURPOSE_PRODUCTION | LC__CMDB__CATG__PURPOSE_PRODUCTION | LC__CMDB__CATG__PURPOSE_PRODUCTION | LC__CMDB__CATG__PURPOSE_PRODUCTION | LC__CMDB__CATG__PURPOSE_PRODUCTION |
| Easyjob                  | Produktion + Test                  | Produktion + Test                  | Produktion + Test                  | Produktion + Test                  | Produktion + Test                  | Produktion + Test                  | Produktion + Test                  | Produktion + Test                  | Produktion + Test                  | Produktion + Test                  | Produktion + Test                  | Produktion + Test                  |
| Filemaker                | Filemaker                          | Filemaker                          | Filemaker                          | Filemaker                          | Filemaker                          | Filemaker                          | Filemaker                          | Filemaker                          | Filemaker                          | Filemaker                          | Filemaker                          | Filemaker                          |
| FTAPI                    | FTAPI                              | FTAPI                              | FTAPI                              | FTAPI                              | FTAPI                              | FTAPI                              | FTAPI                              | FTAPI                              | FTAPI                              | FTAPI                              | FTAPI                              | FTAPI                              |

The Problem is that the cell with the "LC__CMDB__CATG__PURPOSE_PRODUCTION" isn't load correctly.  
If a cell is empty, the template copy the content from the previous cell.  
The content of the cell with "\[B@1e353b9d" must actually looks like this "09:00:00 - 17:00:00" why is the encoding so different?

Best regards,

Stephan

comments: author: Felix Grund (Scandio)
body: Hi Stephan! Sorry for the late reply, somehow we missed this. So is this actually two different issues? One is the column LC__CMDB__CATG__PURPOSE_PRODUCTION whose table name is displayed instead of its contents - and one is the issue with "\[B@1e353b9d"?


author: Stephan Mallmann
body: YOU ARE GREAT!!!

Thank you very much!

comments: author: Felix Grund (Scandio)
body: It's a convention in the Velocity templating language that variables that contain HTML code will only be rendered properly if the variable name ends with "Html". Really funny. Anyway, glad it works! By the way: if you like PocketQuery, would you consider leaving a review at the marketplace?


author: Stephan Mallmann
body: Done ;-)


author: Stephan Mallmann
body: \* \* \* \* \*


Tags: html

pocketquery