# Dynamic New Line

**URL:** <https://forums.losant.com/t/dynamic-new-line/5749>\
**Category:** Help\
**Tags:** workflow, events\
**Created:** [January 27, 2025, 7:02pm UTC](https://forums.losant.com/t/dynamic-new-line/5749 "2025-01-27T19:02:43Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tanner\_Williams](https://avatars.discourse-cdn.com/v4/letter/t/e274bd/32.png) [@Tanner\_Williams](https://forums.losant.com/u/Tanner_Williams)\
**Post date:** [January 27, 2025, 7:02pm UTC](https://forums.losant.com/t/dynamic-new-line/5749/1 "2025-01-27T19:02:43Z")

</div>

Im having an issue with the event node in workflows

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/3/3660e6f2a475f4856df8f8d6031e6ce7fb9c2488.png)  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/2/2395c97098031994db98ba41ed030c99119253b3.png)

creating an event with a \n in it does not escape to a new line but for some reason create a single space in the actual event

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/9/9d4dfcf8124e120cb211ab799fcd9534f229dc58.png)

although you can manually add newlines in the message box of the event node and that works

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/d/d28c0706e3d1ca1810b615c8ee5e96ee15f2869e.png)  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/9/9a5c63ee6b7733101e093143e6d57a04c1f7294c.png)

---

<div class="post-metadata">

**Author:** ![Brandon\_Cannaday](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/brandon_cannaday/32/14_2.png) [@Brandon\_Cannaday](https://forums.losant.com/u/Brandon_Cannaday)\
**Post date:** [January 27, 2025, 7:50pm UTC](https://forums.losant.com/t/dynamic-new-line/5749/2 "2025-01-27T19:50:52Z")

</div>

There are two things going on:

1. Browsers do not interpret `\n` as a newline. So while your message may include a newline character, it will not be rendered.

2. The Message Template field on the Create Event Node supports [Markdown](https://www.markdownguide.org/basic-syntax/). Behind the scenes, your sections of text are converted to HTML paragraph tags, which are then correctly rendered by the browser on different lines.

To get a line break in the resulting event, I recommend using the Create Event Node and using the Markdown [Line Break syntax](https://www.markdownguide.org/basic-syntax/#line-breaks) to get your newlines (two or more spaces at the end of a line).

---

<div class="post-metadata">

**Author:** ![Tanner\_Williams](https://avatars.discourse-cdn.com/v4/letter/t/e274bd/32.png) [@Tanner\_Williams](https://forums.losant.com/u/Tanner_Williams)\
**Post date:** [January 27, 2025, 8:02pm UTC](https://forums.losant.com/t/dynamic-new-line/5749/3 "2025-01-27T20:02:50Z")

</div>

> [@Brandon\_Cannaday](#):
>
> ent, I recommend using the Create Event Node and using the Markdown

Ill have to see how it looks once I get some data coming through but thank you!

---

<div class="post-metadata">

**Author:** ![Tanner\_Williams](https://avatars.discourse-cdn.com/v4/letter/t/e274bd/32.png) [@Tanner\_Williams](https://forums.losant.com/u/Tanner_Williams)\
**Post date:** [January 28, 2025, 8:31pm UTC](https://forums.losant.com/t/dynamic-new-line/5749/4 "2025-01-28T20:31:41Z")

</div>

So im back because it doesnt seem to have worked  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/0/014a9859a8fde59fe7c41064dbeed76fd6a6dbf5.png)

in the message in the payload you can see it has two spaces in it (one is highlighted and one is not)  
however when it renders it doesnt include a new line and only displays one space  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/d/db2f30f44b68786c50497a672859d600778ca350.png)

![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/8/87770d44ab6b886e4246229363896c2c6a14a0a1.png)

in the html of the page it does display as two spaces

---

<div class="post-metadata">

**Author:** ![Brandon\_Cannaday](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/brandon_cannaday/32/14_2.png) [@Brandon\_Cannaday](https://forums.losant.com/u/Brandon_Cannaday)\
**Post date:** [January 28, 2025, 9:01pm UTC](https://forums.losant.com/t/dynamic-new-line/5749/5 "2025-01-28T21:01:23Z")

</div>

I can’t tell from your screenshots where you’re viewing the description, but here’s a test event I created and what it looks like when viewing the result:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/6/6978a921aaf212936249047cf83b7cf1577beca7.png)

I highlighted the two spaces at the end of the first line.

And here’s the Event when viewed in the platform:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/1/1b1a1b848a0bbf877bc591be7e75226e06ff330e.png)

---

<div class="post-metadata">

**Author:** ![Tanner\_Williams](https://avatars.discourse-cdn.com/v4/letter/t/e274bd/32.png) [@Tanner\_Williams](https://forums.losant.com/u/Tanner_Williams)\
**Post date:** [January 28, 2025, 9:05pm UTC](https://forums.losant.com/t/dynamic-new-line/5749/6 "2025-01-28T21:05:49Z")

</div>

The entered text for the description is entirely from the payload

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/d/d05e2c5aad16c74f25433f4d1b66d6d5d0e52ca3.png)  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/7/79458207f4671a70aa1c25886b16d40a58a925d4.png)

the message on the event node response mirrors the inclusion of two space

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/7/75611df4778eb3f2db4d143dad37cc1aa3139338.png)

and so does the html

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/2/23dc81ca1186b0b370ff7b4ad60bf44b674b7abf.png)

but the actual box does not

---

<div class="post-metadata">

**Author:** ![Brandon\_Cannaday](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/brandon_cannaday/32/14_2.png) [@Brandon\_Cannaday](https://forums.losant.com/u/Brandon_Cannaday)\
**Post date:** [January 28, 2025, 9:17pm UTC](https://forums.losant.com/t/dynamic-new-line/5749/7 "2025-01-28T21:17:35Z")

</div>

I see. You’re viewing in CPF. What’s stored on the event is exactly what was typed in the field. The platform UI passes that through a markdown renderer when it’s displayed. CPF does not. We had not considered markdown when creating the CPF. It would be a good feature to add.

You’ll have to now switch to putting HTML in the Event Create Node and making a slight change to the CPF so that your HTML is not escaped.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/6/69b965b69679eea28f9ce400418f90eabd2a879d.png)

Then edit the Experience Page `cpf-page-event-details` and modify line 79 (the exact line number may be different on your version).

Old line:

```auto
<div class="mb-2"><strong>Message:</strong><br>{{pageData.event.message}}</div>

```

New line:

```auto
<div class="mb-2"><strong>Message:</strong><br>{{{pageData.event.message}}}</div>

```

The only change is to surround `pageData.event.message` with triple curly braces (instead of double curly braces). That tells Handlebars to **not** escape any HTML in finds in that value. More details on Handlebars escaping can be found [here](https://handlebarsjs.com/guide/expressions.html#html-escaping).

---

<div class="post-metadata">

**Author:** ![Tanner\_Williams](https://avatars.discourse-cdn.com/v4/letter/t/e274bd/32.png) [@Tanner\_Williams](https://forums.losant.com/u/Tanner_Williams)\
**Post date:** [January 28, 2025, 9:20pm UTC](https://forums.losant.com/t/dynamic-new-line/5749/8 "2025-01-28T21:20:33Z")

</div>

> [@Brandon\_Cannaday](#):
>
> witch to putting HTML in

perfect! Thanks  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/1/1daabbbbb40cd8bd9f521531347bfcf112ee7173.png)
