I'm trying to reference SalesCloud event data inside an SMS interaction in journey builder:
%%[set @fname = AttributeValue('Contact:FirstName')]%%
Hello %%=v(@fname)=%%!
This doesn't return any value for Contact First Name. I found a workaround where I use LookupOrderedRows and use Mobile Number to search entry event DE to retrieve FirstName.
%%[
set @number = MOBILE_NUMBER
set @orderedRows = LookupOrderedRows('DE', 1, 'Contact:CreatedDate DESC', 'Contact:MobilePhone', Concat('+', @number))
if RowCount(@orderedRows) > 0 then
set @fname = Field(Row(@orderedRows, 1), 'Contact:FirstName')
endif
]%%
Hello %%=v(@fname)=%%!
This works fine for short journeys or no re-entry type ones, but for long one that allows to re-enter anytime I don't have 100% certainty of getting correct entry data. Wanted to ask, if I'm maybe using AttribueValue incorrectly or is there a better way to get the information I want?