Select Page

## V

This function outputs the value of a variable. It is commonly used when a variable is defined within a code block and the result is displayed in an email, message or web page.

### Argument

`V(1)`

Ordinal Type Required Description
1 String True Variable value to output

### Example

The following example returns the result of a variable from a code block and displays it inline within an HTML tag.

``````%%[

var @firstName, @displayName

set @firstName = AttributeValue("First Name")

if empty(@firstName) then
set @displayName = "friend"
else
set @displayName = @firstName
endif

]%%
<p>Hello %%=v(@displayName)=%%,</p>``````

#### Output

The function will output the value of the variable. For a Sendable Data Extension containing the `First Name` field value `Barb`, the following output will be displayed:

``<p>Hello Barb,</p>``
{"ft_lang_label":"__label__en","ft_lang_prob":0.509047,"math_prob":0.67309624,"size":803,"snap":"2019-51-2020-05","text_gpt3_token_len":186,"char_repetition_ratio":0.14017522,"word_repetition_ratio":0.0,"special_character_ratio":0.23536737,"punctuation_ratio":0.0729927,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.95945895,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-01-29T10:30:54Z\",\"WARC-Record-ID\":\"<urn:uuid:5e1d53d4-ecc3-47cd-a77f-5d4754999321>\",\"Content-Length\":\"105349\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:110e2855-1962-4efd-9f85-07c708f5551a>\",\"WARC-Concurrent-To\":\"<urn:uuid:c8104754-0ae5-4b05-b3b7-86e4f4caf9dd>\",\"WARC-IP-Address\":\"104.26.7.90\",\"WARC-Target-URI\":\"https://ampscript.guide/v/\",\"WARC-Payload-Digest\":\"sha1:COCORCCYLJJY7IHXTMFMCINQ4YTWSXRP\",\"WARC-Block-Digest\":\"sha1:TBP7ZDTQ4M6NGS3H6VIBUZOF5VON7BXO\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-05/CC-MAIN-2020-05_segments_1579251796127.92_warc_CC-MAIN-20200129102701-20200129132701-00267.warc.gz\"}"}