OutputLine()
Returns the result of an AMPscript function, such as Concat() or v(), and includes the result inside the rendered content. The function also appends a newline (CRLF) character after the result of the nested function.
This function only outputs the result of a nested function. If you pass a string or any other literal as the parameter, the function doesn’t output a result.
The OutputLine()
function has one parameter:
value
(AMPscript function): Required. The function that produces the results to be output by the system.
This example uses the OutputLine()
function to output the result of two nested functions. The first occurrence of the OutputLine()
function uses the Concat()
function to join the value of a variable with another string of text. The second occurrence uses the v()
function to output the value of a variable.
The example returns this text.
When the output is rendered as HTML, the results of both functions are shown on a single line. This behavior occurs because the function adds a carriage return plus line feed (CRLF) character to the end of the output, as opposed to an HTML line break (<br/>
). In other outputs, such as the text version of an email or an SMS message, the outputs appear on separate lines.