Business Rule - Adding break in HTML

alexcharleswort
Tera Expert

i all,

This is what I am trying to accomplish:

On table_a I have a variable called u_update. It is a string field. When the record on table_a is closed, I want it to take whatever the user put in u_update and populate it in table_b in current_update. current_update is an HTML field.

I've got that working, not a problem. Then, if another record on table_a is closed, I want it to take whatever is in u_update on that record and add it to current_update in table_b. this is also working.

The issue that I am having is I want u_update from table_a and table_b separated by a break. This works fine if I am populating a string field on table_b but not the HTML field. in the HTML field it is just add in a space. Any ideas how to do this? The line in my business rule script is:

update.current_update = update.current_update   + "\n"   + current.u_update;

Table A                                                                     -->           Table B (what it looks like now)         -->                   Table B (what I would like it to look like)

1st Record: Peanut Butter                                                                     Peanut Butter Jelly                                         Peanut Butter

2nd Record: Jelly                                                                                                                                                                                                       Jelly

Hopefully that's clear. Like I said, I can get it to work if the variable on table B is a string, but not if it's HTML

Any help would be greatly appreciated!

Thanks,

Alex

1 ACCEPTED SOLUTION

Brad Tilton
ServiceNow Employee
ServiceNow Employee

Have you tried using an html line break into the HTML field?



So use <br/> instead of \n


View solution in original post

4 REPLIES 4

Brad Tilton
ServiceNow Employee
ServiceNow Employee

Have you tried using an html line break into the HTML field?



So use <br/> instead of \n


Thanks, Brad!!


Sadly it took that post to make many things click in my mind that should have a long time ago 😕


No worries, sometimes it just takes a second set of eyes!


Hi! one question, in one business rule,  can you put html code?