Runtime verified Test scripts included

Syntax

OutputLine(content)  →  void

Parameters

Name Type Required Description
content function call Yes Function call whose result is written; a literal or bare variable renders only the line break

There is no upper bound on the argument count — several values are written in turn, followed by a single break — but the single-argument form is the only one the official reference supports.

Example

%%[ OutputLine(Concat("Hello ", "world")) ]%%

Renders Hello world followed by a carriage return and line feed.

Because the break is not an HTML break, an HTML view collapses consecutive lines unless the content sits inside a preformatted element:

<pre>
%%[
  OutputLine(Concat("first"))
  OutputLine(Concat("second"))
]%%
</pre>

Return value

void — nothing is returned.

There is no value to test for, and no closed set of sentinel values. Because nothing comes back, the call cannot be nested inside another function: placing it inside a Concat aborts the surrounding block with HTTP 422.

Behaviour

A bare literal or variable renders only the break. The value is dropped exactly as it is by Output; the break still appears. <L3> and </L3> came back on two separate lines with nothing between them.

An argument that produces no text still breaks the line. That is why an empty call is the standard way to end a line in a script that otherwise writes with Output.

Consecutive calls put each value on its own line. Two calls writing P and Q rendered them on separate lines inside their delimiters.

Several arguments produce one line, not several. Two arguments rendered ab and three rendered abc, each followed by a single break. A call with no argument at all writes just the break.

A number or a date is accepted but only the break appears. OutputLine(456) rendered an empty line, while the same value routed through a function call rendered normally.

The two bytes it appends

Reading the rendered page only shows that a line ended. Reading the raw response bytes shows what was actually written: the two bytes immediately after the value are 13 and 10 — a carriage return followed by a line feed. No <br> element appears anywhere in the body.

Sequence Rendered bytes after the value
Output(Concat("A")) none
OutputLine(Concat("A")) 13, 10

That matches what the official reference says, and it is the reason the lines collapse in an HTML view: browsers treat a CRLF as whitespace. In a plain-text email or an SMS body the lines stay separate.

Show test script
%%[
  VAR @b, @v
  SET @b = RequestParameter("b")

  /* known-good control: renders on every request, so a run of HTTP 422s
     can be told apart from a broken deploy */
  OutputLine(Concat("CTRL=[", Uppercase("ok"), "]"))

  /* the injected break, delimited so it is visible as a position rather
     than inferred. The closing marker lands on the next line. */
  OutputLine(Concat("--- L start ---"))
  Output(Concat("<O1>"))
  Output(Concat("A"))
  Output(Concat("</O1>"))
  OutputLine(Concat(""))
  Output(Concat("<L1>"))
  OutputLine(Concat("A"))
  Output(Concat("</L1>"))
  OutputLine(Concat(""))

  /* an argument that produces no text: the break still appears */
  Output(Concat("<L2>"))
  OutputLine(Concat(""))
  Output(Concat("</L2>"))
  OutputLine(Concat(""))

  /* a bare literal and a bare variable: only the break appears */
  SET @v = "vee"
  Output(Concat("<L3>"))
  OutputLine("bare")
  Output(Concat("</L3>"))
  OutputLine(Concat(""))
  Output(Concat("<L4>"))
  OutputLine(@v)
  Output(Concat("</L4>"))
  OutputLine(Concat(""))

  /* two calls in a row put each value on its own line */
  Output(Concat("<L5>"))
  OutputLine(Concat("P"))
  OutputLine(Concat("Q"))
  Output(Concat("</L5>"))
  OutputLine(Concat(""))
  OutputLine(Concat("--- L done ---"))

  /* argument counts the catalogued signature does not allow */
  IF @b == "arity" THEN
    OutputLine(Concat("--- arity start ---"))
    OutputLine()
    OutputLine(Concat("a"), Concat("b"))
    OutputLine(Concat("a"), Concat("b"), Concat("c"))
    OutputLine(Concat("--- arity done ---"))
  ENDIF

  /* nesting the call inside another function: aborts this branch only */
  IF @b == "nest" THEN
    OutputLine(Concat("--- nest start ---"))
    OutputLine(Concat("NEST=[", Concat("x", OutputLine(Concat("y")), "z"), "]"))
    OutputLine(Concat("--- nest done ---"))
  ENDIF

  /* non-string arguments */
  IF @b == "nonstr" THEN
    OutputLine(Concat("--- nonstr start ---"))
    Output(Concat("<N1>"))
    OutputLine(456)
    Output(Concat("</N1>"))
    OutputLine(Concat(""))
    Output(Concat("<N2>"))
    OutputLine(Now())
    Output(Concat("</N2>"))
    OutputLine(Concat(""))
    OutputLine(Concat("--- nonstr done ---"))
  ENDIF
]%%

Availability

Platform Available
Marketing Cloud Engagement Yes
Marketing Cloud Next Yes, from API 67.0

See also