sfmc // AMPscriptPRODUCTION
Defensive AttributeValue() + Empty() Fallback
Read a send-context attribute without assuming the field always exists or contains a value.
ampscriptattributevalueemptyfallback
Trust & provenancePRODUCTION
Evidence tierPRODUCTIONOfficial sources2Other sources0Last verified2026-10-05
Evidence tier describes my hands-on relationship with the content. Official sources describe platform contracts/documentation. Production observations should not automatically be treated as official limits.
Personalization can safely fall back to a default.
%%[
VAR @firstName
SET @firstName = AttributeValue("FirstName")
IF Empty(@firstName) THEN
SET @firstName = "Cliente"
ENDIF
]%%
Olá %%=v(@firstName)=%%,AttributeValue() returns null when the attribute is not found; Empty() handles null/empty values before output.
This is safer than direct personalization when a missing attribute should not break rendering.