# Canvas markdown is not showing data

**URL:** <https://discuss.elastic.co/t/canvas-markdown-is-not-showing-data/193442>\
**Category:** Kibana\
**Created:** [August 2, 2019, 4:49am UTC](https://discuss.elastic.co/t/canvas-markdown-is-not-showing-data/193442 "2019-08-02T04:49:43Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![syedsfayaz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/syedsfayaz/32/46657_2.png) [@syedsfayaz](https://discuss.elastic.co/u/syedsfayaz)\
**Post date:** [August 2, 2019, 4:49am UTC](https://discuss.elastic.co/t/canvas-markdown-is-not-showing-data/193442/1 "2019-08-02T04:49:43Z")

</div>

Hi

In canvas markdown. I am using elastic sql to pull data from metric beat and sorting it to latest document as I wanted to see the latest result of the jenkins job.  
`SELECT http.json_test.building,http.json_test.url,http.json_test.result FROM "metricbeat-*" ORDER BY "@timestamp" DESC LIMIT 1`

This is the correct result.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/1/6/16322088f50e8185e93e350f1098bbebdefe44a2.png)

Now I want to show only "http.json\_test.url" value on markdown. when I used this code in markdown content I can see the column names as expected.

> ```
> {{#each columns}}
> {{name}}
> {{/each}}
> 
> ```

![image](https://us1.discourse-cdn.com/elastic/original/3X/5/4/5440e9fa8363611d15cf109f00917af77519e8e7.png)

But when I change the code to below I get a blank results. Please guide me how I can achieve this.

> ```
> {{#each rows}}
> {{http.json_test.url}} 
> {{/each}}
> 
> ```

![image](https://us1.discourse-cdn.com/elastic/original/3X/1/5/158b8fe169efc0eb1a7dfc3298b5c4ad7e9e6c12.png)

---

<div class="post-metadata">

**Author:** ![lukeelmers](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukeelmers/32/35230_2.png) [@lukeelmers](https://discuss.elastic.co/u/lukeelmers)\
**Post date:** [August 2, 2019, 6:48pm UTC](https://discuss.elastic.co/t/canvas-markdown-is-not-showing-data/193442/2 "2019-08-02T18:48:45Z")

</div>

Hi @syedsfayaz,

Since your column name contains `.`, try putting it in single quotes, or escaped double quotes:

```auto
 {{#each rows}}
 {{\"http.json_test.url\"}} 
 {{/each}}

```

Alternatively if you are using SQL, you could rename it there:

```auto
SELECT http.json_test.building, http.json_test.url as url, http.json_test.result FROM "metricbeat-*" ORDER BY "@timestamp" DESC LIMIT 1

```

And then in the markdown:

```auto
 {{#each rows}}
 {{url}} 
 {{/each}}

```

---

<div class="post-metadata">

**Author:** ![syedsfayaz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/syedsfayaz/32/46657_2.png) [@syedsfayaz](https://discuss.elastic.co/u/syedsfayaz)\
**Post date:** [August 2, 2019, 7:08pm UTC](https://discuss.elastic.co/t/canvas-markdown-is-not-showing-data/193442/3 "2019-08-02T19:08:49Z")

</div>

@lukeelmers Thank you for your reply. Single quotes or backslash did not work but adding an alias names worked .

1. Can I use the same settings in visual builder markdown. Will this work?
2. Since I am having result column(Success/failed) . I want to change the color for markdown to "Red " when it is failed and green when successful . Any idea how I can achieve it.

---

<div class="post-metadata">

**Author:** ![lukeelmers](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukeelmers/32/35230_2.png) [@lukeelmers](https://discuss.elastic.co/u/lukeelmers)\
**Post date:** [August 2, 2019, 11:25pm UTC](https://discuss.elastic.co/t/canvas-markdown-is-not-showing-data/193442/4 "2019-08-02T23:25:47Z")

</div>

> 1. Can I use the same settings in visual builder markdown. Will this work?

Yes, visual builder supports handlebar templates in markdown, however, it does not use the same querying infrastructure that Canvas uses (so you won't be able to use the same Canvas expression with SQL to get your data).

If you are able to get the results you are looking for by configuring visual builder, then it should be possible to access the values from within the markdown. The data is just structured a bit differently.

> 1. Since I am having result column(Success/failed) . I want to change the color for markdown to "Red " when it is failed and green when successful . Any idea how I can achieve it.

I don't think this exactly helps in your situation, but generally you can do this by editing the expression directly and using the `if` statement inside of the `font` argument:

```auto
markdown font={font color={if {getCell column="http.json_test.result" row=0 | eq "success"} then=green else=red}} "hello"

```

However, I don't think you can specify multiple color values within a single markdown element -- so if you were wanting to color each item in your list differently, I don't think that will work here.

In my example above I am using `getCell` to pull from row `0` of the `http.json_test.result` column -- so as you can see, you're limited on setting a single color.

---

<div class="post-metadata">

**Author:** ![syedsfayaz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/syedsfayaz/32/46657_2.png) [@syedsfayaz](https://discuss.elastic.co/u/syedsfayaz)\
**Post date:** [August 2, 2019, 11:31pm UTC](https://discuss.elastic.co/t/canvas-markdown-is-not-showing-data/193442/5 "2019-08-02T23:31:54Z")

</div>

@lukeelmers I want to change the color of entire markdown widget, So I can show it as a status indicator. It will look like this.  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/0/406a6bc5e908ecaca670676129709a3dda09184a.png)

One more last question. Is it possible to change the shape of markdown widget. In which case I can create multiple markdowns and added them side by side to show a pipeline.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/5/75cd31fa8b2f6d12879648032dec690c83ebe286.png)

---

<div class="post-metadata">

**Author:** ![lukeelmers](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukeelmers/32/35230_2.png) [@lukeelmers](https://discuss.elastic.co/u/lukeelmers)\
**Post date:** [August 2, 2019, 11:52pm UTC](https://discuss.elastic.co/t/canvas-markdown-is-not-showing-data/193442/6 "2019-08-02T23:52:06Z")

</div>

You can't change the shape of the markdown widget, but you could use a separate shape element and conditionally color it. The implementation of this would involve a similar technique to what I described above, only applied to the `shape` function instead.

This thread may be of interest, as it is solving a very similar problem: [Can't get shape to render with correct color](https://discuss.elastic.co/t/cant-get-shape-to-render-with-correct-color/193552)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 30, 2019, 11:52pm UTC](https://discuss.elastic.co/t/canvas-markdown-is-not-showing-data/193442/7 "2019-08-30T23:52:12Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
