- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2022 11:37 AM
I have added a Read Only HTML field to incidents, u_bp_description with a UI policy to show u_bp_description if the incident was created via a BigPanda automation share. It will display a formatted representation of a BigPanda incident in ServiceNow like this:
The problem I have noticed is that if anything is changed or if the view is switched, the field will be reformatted and then it looks like this:
The gray blocks are added like <pre> content \n content continued </pre>
If the integration updates the field, then the formatting will get corrected, but if it doesn't then it looks terrible.
Is there a better way to do this such that the content will retain it's formatting?
Thanks,
Jaffer
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2022 12:44 PM
Hi,
So it looks like the line break is being escaped or something to that effect to cause the rendering issue you're seeing. When you receive it from the source, are those lines pre-formatted with <pre> and all that or is that something you are doing on your end?
Curious if you utilize a separate way to line break, like <br>, would that have a better result for you?
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2022 12:44 PM
Hi,
So it looks like the line break is being escaped or something to that effect to cause the rendering issue you're seeing. When you receive it from the source, are those lines pre-formatted with <pre> and all that or is that something you are doing on your end?
Curious if you utilize a separate way to line break, like <br>, would that have a better result for you?
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2022 02:02 PM
Hi Allen,
The source arrives as a JSON payload into a custom form, I use a Transform Map with a source script. I parse the JSON and then loop through the payload, I was using the <pre> block mainly because it's easy and it had the desired format... Using a <br> in a <pre> block wouldn't work because it would just be rendered as content<br>additional content...
Soooo... What you said made me think about it, not be so lazy, and then rewrite the code such that the content blocks are tables with the formatting I wanted and using <br> to split the lines...
That actually works perfectly... I was so busy trying to figure out how the linefeeds were getting removed, I didn't think about just generating the HTML with the format I wanted...
Thanks!!
-Jaffer

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2022 02:07 PM
Hi
Yeah, that was more so what I was getting at. I'm glad you kind of read between the lines there, haha.
I was curious if it was preformatted or if you were working magic anyway, and if so, just format it a bit more there.
Glad I could help guide you a bit.
Please mark my initial reply above as Correct, if applicable. Thanks! 🙂
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!