Approval description is not having line breaks in service now portal approval form.

Balaram7
Kilo Sage

Hi all, 

 

Need your help in displaying the description with the line breaks on the approval form.

Since we dont have option of displaying the description on the approval form, we cloned OOB Approval widget and added the below lines in the body HTML template.

Balaram7_0-1676285212522.png

Can anyone please help me with what tags need to be added in html to display line breaks in the description of approval form.

 

Thank you,

Balaram.

 

 

7 REPLIES 7

Hi @Balaram7 ,

 

I have cloned the approvals widget.

Here is my code snippet.

Without <br> tag

<div ng-if="approval.task.opened_by"><label>${Requestor}</label>  {{::approval.task.opened_by}}</div>

HemantGoldar_0-1676307855327.png

 

With <br> tag.

          <div ng-if="approval.task.opened_by"><label>${Requestor}</label> <br> {{::approval.task.opened_by}}</div>

HemantGoldar_1-1676307990187.png

 

I hope this helps!

 

Regards,

Hemant 

**Please mark my answer correct or helpful based on the impact**

Hi Hemant,

 

My requirement is that the value we are copying from the description field is not getting populated with the line breaks, instead the description value is getting copied as paragraph.

Please help me to copy the value similarly how it is being displayed on the RITM table as well.

Balaram7_0-1676893167915.pngBalaram7_1-1676893216783.png

 

Thank you,

Balaram.

Hello, please try adding this to your tag

style="white-space:pre-line"

 

That should preserve the line breaks. See below article. 

 

https://www.servicenow.com/community/developer-forum/how-can-i-show-line-breaks-from-string-field-in...

 

Hope this helps

Lisa