Add a new line in string field in record producer

Riaz3
Giga Expert

Hi,

Does anyone know how to add a new line in a record producer?

I have this code 

current.description = (('what is the need?') + (' ') + producer.What_is_it_that_you_need)
+ (' ') + (' ') +
(('when do you need it?') + (' ') + producer.When_do_you_need_it);

I would like to add a new line from  (('when do you need it?') + (' ') + producer.When_do_you_need_it);

Thanks

1 ACCEPTED SOLUTION

Manish Vinayak1
Tera Guru

Hi Riaz,

Use the "\n" escape character to insert a new line in your text string:

current.description = 'what is the need?' + '\n' + producer.What_is_it_that_you_need + '\n\n' + 'when do you need it?' + '\n' + producer.When_do_you_need_it;

if written more clearly:

current.description = 'what is the need?\n';
current.description += producer.what_is_it_that_you_need + '\n\n';
current.description += 'when do you need it?\n';
current.description += producer.when_do_you_need_it;

 

Give it a try. Hope this helps!

Cheers,

Manish

View solution in original post

9 REPLIES 9

Manish Vinayak1
Tera Guru

Hi Riaz,

Use the "\n" escape character to insert a new line in your text string:

current.description = 'what is the need?' + '\n' + producer.What_is_it_that_you_need + '\n\n' + 'when do you need it?' + '\n' + producer.When_do_you_need_it;

if written more clearly:

current.description = 'what is the need?\n';
current.description += producer.what_is_it_that_you_need + '\n\n';
current.description += 'when do you need it?\n';
current.description += producer.when_do_you_need_it;

 

Give it a try. Hope this helps!

Cheers,

Manish

Perfect, that you that worked. And also many many thanks for tidying up the code.

 

Glad that it helped 🙂

Cheers,

Manish

Hi @Manish Vinayak1 and @Allen Andreas 

I tried both the above ways but the output is not getting printed in the next line.

aakashps_0-1746518450133.png

This is my output and my description field is an HTML type as well .

aakashps_1-1746518471609.png

Could you please provide your inputs to resolve this issue.