Verification in progress Differs from official docs Test scripts included

Syntax

v(variableName)  →  string
1 argument — exactly

Parameters

Name Type Required Description
variableName string | number Yes Variable reference, literal or nested function call to output

Example

%%[ SET @word = "zeta" ]%%
<p>%%=v(@word)=%%</p>

Renders <p>zeta</p>.

Return value

string — the value, written as text.

The value can be anything, so there is no fixed set of results to test for.

Behaviour

A variable is written as its value. A variable set to "zeta" renders zeta; one set to 7 renders 7.

A number literal is accepted. v(5) renders 5.

A quoted name is written as itself. v("p") renders the letter p, not the value of a variable called p. A typo such as v("id") therefore renders the word id instead of failing.

Exactly one argument. An email with v() or with v(@a, @b) cannot be saved: the content API answers HTTP 400 with “The AMPscript syntax isn’t valid”.

Nested function calls, request parameters and subscriber attributes were not tested in Next.

Show Next test script
<!-- Marketing Cloud Next test script for v. Paste it into the HTML component of a
     Next email and open the preview. Each line prints the result Next gave when the call
     was rendered on its own (expect) next to the result of this run (got).
     Assembled from single-call test emails (dates on the page); it has not been
     run as one email. Calls that make Next fail are listed separately. -->
<p>c1 expect=[zeta] got=[%%[ SET @vz1 = "zeta" ]%%%%=v(@vz1)=%%]</p>
<p>c2 expect=[p] got=[%%=v("p")=%%]</p>
<p>c3 expect=[5] got=[%%=v(5)=%%]</p>
<p>c4 expect=[7] got=[%%[ SET @r2vn = 7 ]%%%%=v(@r2vn)=%%]</p>

Show calls that fail in Next (one email each)
<!-- Run each call below in its own Next email: one of them in a combined email
     would stop the whole preview or block the save. -->

<!-- email 1: expect that the save is rejected (HTTP 400) -->
%%=v()=%%

<!-- email 2: expect that the save is rejected (HTTP 400) -->
%%[ SET @r2ve1 = "a" SET @r2ve2 = "b" ]%%%%=v(@r2ve1,@r2ve2)=%%

Differs from official docs

  • A quoted name is written as itself. The docs type the argument as a string naming the variable. In Next v("p") rendered p, not the value of @p. Card

Availability & differences

PlatformAvailable
Marketing Cloud EngagementYes
Marketing Cloud NextYes, from API 67.0
Same in Marketing Cloud Engagement

Variables, string literals and numbers render the same on both platforms. Compared 2026-11-23 by rendering the same calls in a Marketing Cloud Next email.

See also