Notification toString() problem

avinashdubey103
Tera Guru

Hi , I have a requirement to print the u_questionaire field of request item in a notifcation 

I have wrtitten a email script in that iam using this 

 

I am using this script :

var u_questionnaire_value = current.u_questionnaire.toString();
 
but the output is not formatted:
avinashdubey103_0-1703594462042.png

 

1 ACCEPTED SOLUTION

@avinashdubey103  can you please share screenshot of your record that is storing this value on form?

Is it storing data on separate lines in Questionnaire field?

 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

View solution in original post

11 REPLIES 11

It is printing unidentified  string

Muhammad Hamza
Kilo Sage

Hey @avinashdubey103, adding to the Anil answer,

 

var u_questionnaire_value = current.getValue('u_questionnaire');

 

Add an HTML tag at the end of every line</br> in the template.print().
Then you can use it like this,

 

var html = "";
html += "<p>Question 1:"+variable_1+"</p><br/>";
html += "<p>Question 2:"+variable_2+"</p><br/>";
template.print(html)

 

It should solve your line break problem.

Kindly appreciate the efforts of community contributors by marking appropriate response as the correct solution and helpful, this may help other community users to follow the right solution in the future.

Thanks,

Hamza