I have created a DE with a date_submit field added so when a contact gets added the time stamp is automatically in there mm/dd/yy/sec.
I have a ampscript lookup where it is working fine in showing all the records.
%%[ var @rows, @row, @rowCount, @i set @rows = LookupRows('DE-test','List_name','segment_1') set @rowCount = rowcount(@rows) if @rowCount > 0 then for @i = 1 to @rowCount do var @emailAddress, @subscriber_key set @row = row(@rows, @i) /* get row based on counter */ set @name = field(@row,"Name") set @emailAddress = field(@row,"Email") set @phone = field(@row,"Phone") set @pdate = field(@row,"Available Date") set @date_submitted = field(@row,"date_submitted") ]%%
I was wondering is it possible to show only the latest entry instead of all the records?
I know I have added in the date_submitted field to the code below but now sure how to add in the filter logic where it will only pull the recent contact.
set @rows = LookupRows('DE-test','date_submitted','')