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

Allen Andreas
Administrator
Administrator

Hi,

Please try:

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

So this trims things down for you and adds a space after the question so you don't need extra long code adding in more + ' ' + etc.

This also adds a line break between the first question and answer and the second question and answer.

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Thank you Allen 

Hi,

So did my reply/code not work for you? I believe I read your post/reply correctly and what you wanted?

Just wanted to make sure if I read your post correctly.


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Hi  Allen,

 

I dont want to mention questions like" What is the need, What_is_it_that_you_need ", but  whatever the data in the multiline in the form ( 1st line , 2nd line..) , similar to the SC request needs to be updated in the description filed( 1st line, 2nd line ..)

 

how to mention the code/script in the Record producer.

 

Please help

Thankyou

Prabhu

Hi! 🙂

This question was from almost 4 years ago.

If you don't mind, please create a new question for your specific ask and feel free to tag me in it by using the @ symbol and I'll get notified. This allows others to jump in and help as well as most won't look at this question because it's already been answered.


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!