How do I add a newline or linebreak in a Confiform textarea type field?
Asked by VD:

I have a textarea field that must show multiple lines in different lines. The field is populated using a form field rule like this:

lookupResult=**US:** \[entry.lookupResultPSAN\] **UK:** \[entry.lookupResultPPEP\] **France:**\[entry.lookupResultPAM\]

The bolded part appears on one line, and then the value should appear in the next line.

I tried \\n and \\\\ , but neither seems to work. My output always appears like this:

US:\\n\<output\> UK:\\\\ \<output\>France: \<output\>

What can I use as newline character when assigning values to show in a textarea?


Answers:
author: Alex Medved _ConfiForms_
body: \\n makes the next line

comments: author: VD
body: I tried \\n but it shows up as \\n in my output form. How do I stop it from showing as \\n and just have the data displayed on the next line? Are there spaces or quotes to be added?


author: Alex Medved _ConfiForms_
body: Sorry, it must be \\\\n

(double slash n... seems to be removed from my previous answer)

See the demo below

<http://recordit.co/u8aXUAZ9MB>


author: VD
body: Thanks a lot! \\\\n worked like a charm to add line breaks!


author: Noah Leu
body: Hello [@Alex Medved _ConfiForms_](/t5/user/viewprofilepage/user-id/781630)

is it possible to also use bold text and italics? I tried some \<b\>\</b\> stuff, but could not manage to do it.

In my case it is a "Rules for Definition" with a value to set. The line breaks worked fine for me.

Thank you in advance!


author: Alex Medved _ConfiForms_
body: Textarea is not an HTML (holding) field, so you cannot use HTML tags there


author: Noah Leu
body: Thank you! That response was insanely fast!


author: Alex Medved _ConfiForms_
body: ConfiForms has fields that can hold the HTML - you can use those or even "textarea", but when you reference this field via ConfiForms Field macro then you can use "renderAsHtml" function

Something like

```
mytextareafield.renderAsHtml
```

<https://wiki.vertuna.com/display/CONFIFORMS/Virtual+functions>

Alex


author: Sopaboba
body: Hi guys.

I am having problems with something similar, but in my case I try to convert a smart multiselect field in a textarea with different lines. Imagine the multiselect field has been chosen with three different values: MADRID BARCELONA VALENCIA.

I want to show the result in different lines:

MADRID

BARCELONA

VALENCIA

How should I do it? Appending \\\\n to the following chain: \[entry.mymultiselectfield.transform(label).append(\\\\n)\]

A little bit lost with this.


author: Alex Medved _ConfiForms_
body: It is about appending \\\\n to each label..

```
[entry.mymultiselectfield.transform(label.append(\\n))]
```


author: Sopaboba
body: Too busy today at the office. I will try tomorrow, but I am totally sure it will work. Thanks again.


author: Tanmay Gadkari
body: Have a related question related to line breaks.

I am trying to pass an Acceptance Criteria to our JIRA tickets from a ConfiForm. The Acceptance Criteria is hardcoded in a hidden field. There are two bullets for the Acceptance Criteria. Trying to get them on different lines but nothing works. Here is the linebreak attempt:

![linebreak.png](https://community.atlassian.com/t5/image/serverpage/image-id/189872iC95C35620CE31B3C/image-size/large?v=v2&px=999 "linebreak.png")

Result I get is this:

![linebreak2.png](https://community.atlassian.com/t5/image/serverpage/image-id/189874i71739A12F2D085CF/image-size/large?v=v2&px=999 "linebreak2.png")

Any help will be appreciated.

[@Alex Medved _ConfiForms_](/t5/user/viewprofilepage/user-id/781630) any ideas?

comments: author: Alex Medved _ConfiForms_
body: Try setting with one \\

\\n

As this is not a parameter to function where you need to escape it with a double \\\\


author: Tanmay Gadkari
body: Brilliant!! Worked like a charm... Thanks so much [@Alex Medved _ConfiForms_](/t5/user/viewprofilepage/user-id/781630) !!!


Tags: confiforms

confluence-server

format

server