# Canvas Expression Syntax NewLine & Comments

**URL:** https://discuss.elastic.co/t/canvas-expression-syntax-newline-comments/299796
**Category:** Kibana
**Tags:** canvas
**Created:** [March 15, 2022, 9:44pm UTC](https://discuss.elastic.co/t/canvas-expression-syntax-newline-comments/299796 "2022-03-15T21:44:20Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![GoncaloCarvalho](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/goncalocarvalho/32/103087_2.png) [@GoncaloCarvalho](https://discuss.elastic.co/u/GoncaloCarvalho)
#### Post date: [March 15, 2022, 9:44pm UTC](https://discuss.elastic.co/t/canvas-expression-syntax-newline-comments/299796/1 "2022-03-15T21:44:20Z")

</div>

Greetings,

I need help with two specific features, would greatly appreciate any help you could hand me.

I'm setting up a canvas Workpad and I wanted to add some sort of documentation through comments in my code, so other people working on the same project can later on understand why I've taken a certain approach. I haven't seen anything documented about how to achieve that yet.

Secondly, I'm building a string variable that I'm later going to reference inside the markdown section of this text box element, and I wanted to add a line breaker/new line character inside this variable and so far I have failed short of it as well.

Thanks in advance!

---

<div class="post-metadata">

### Author: ![nickpeihl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nickpeihl/32/112622_2.png) [@nickpeihl](https://discuss.elastic.co/u/nickpeihl)
#### Post date: [March 16, 2022, 1:59pm UTC](https://discuss.elastic.co/t/canvas-expression-syntax-newline-comments/299796/2 "2022-03-16T13:59:34Z")

</div>

Hi @GoncaloCarvalho.

You can add comments in the [Canvas Expression Editor](https://www.elastic.co/guide/en/kibana/current/canvas-expressions-always-start-with-a-function.html#canvas-expressions-always-start-with-a-function) the same way it is [done in JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#comments) using either `// <my comments>` for single line comments or `/* <my comments> */ ` for multiple lines.

Variables in Canvas also act the same way as JavaScript. So you can use a backslash (`\`) to terminate a line within the string. For example:

```auto
kibana
| var_set myvariable value='This\
variable\
has\
multiple\
lines'
| markdown {var myvariable}
| render

```

---

<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: [April 13, 2022, 1:59pm UTC](https://discuss.elastic.co/t/canvas-expression-syntax-newline-comments/299796/3 "2022-04-13T13:59:58Z")

</div>

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