How do I add a newline or linebreak in a Confiform textarea type field?

VD July 7, 2021

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?

2 answers

1 accepted

1 vote
Answer accepted
Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 7, 2021

\n makes the next line

VD July 7, 2021

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?

Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 7, 2021

Sorry, it must be \\n

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

See the demo below

http://recordit.co/u8aXUAZ9MB 

Like VD likes this
VD July 7, 2021

Thanks a lot!  \\n worked like a charm to add line breaks!

Noah Leu September 15, 2021

Hello @Alex Medved _ConfiForms_

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!

Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 15, 2021

Textarea is not an HTML (holding) field, so you cannot use HTML tags there

Like Noah Leu likes this
Noah Leu September 15, 2021

Thank you! That response was insanely fast! 

Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 15, 2021

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

Sopaboba October 20, 2021

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.

Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 20, 2021

It is about appending \\n to each label..

[entry.mymultiselectfield.transform(label.append(\\n))]
Like Sopaboba likes this
Sopaboba October 21, 2021

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

0 votes
Tanmay Gadkari
Contributor
March 24, 2022

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

Result I get is this:

linebreak2.png

Any help will be appreciated. 

@Alex Medved _ConfiForms_  any ideas?

Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 24, 2022

Try setting with one \

\n

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

Like Tanmay Gadkari likes this
Tanmay Gadkari
Contributor
March 24, 2022

Brilliant!! Worked like a charm... Thanks so much @Alex Medved _ConfiForms_ !!! 

Saiful Hasan
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 31, 2024

Hi @Alex Medved _ConfiForms_ how do I allow users to use a blank line in a TextArea field? One of the users entered two lines of text and a blank line between them. This generated an error message when he tried to submit the form. Appreciate any help here, thanks.

Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 31, 2024

What error do your users get!? TextArea allows and supports new lines - I dont understand what you are talking about? 

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events