How to clear the trouble with the ampscript lookup function?

266    Asked by Aalapprabhakaran in Salesforce , Asked on Feb 27, 2023
 %%[ VAR @EventType, @DateTime, @Address
SET @EventType = Lookup("CampaignMember_Contact_Builder", "Event_Type__c", "ContactId", _subscriberkey)
SET @DateTime = Lookup("CampaignMember_Contact_Builder", "Event_Date__c", "ContactId", _subscriberkey)
SET @Address = Lookup("CampaignMember_Contact_Builder", "Address__c", "ContactId", _subscriberkey)]%%
Having trouble with my lookup function. When called, these vars are not returning anything in preview. All data comes from Salesforce using the connector.

Try using the attribute value ampscript lookup function to capture the subscriberkey.


eg
%%[ VAR @EventType, @DateTime, @Address , @SubscriberKey
SET @SubscriberKey = AttributeValue("_subscriberkey")
SET @EventType = Lookup("CampaignMember_Contact_Builder", "Event_Type__c", "ContactId", @SubscriberKey)
SET @DateTime = Lookup("CampaignMember_Contact_Builder", "Event_Date__c", "ContactId", @SubscriberKey)
SET @Address = Lookup("CampaignMember_Contact_Builder", "Address__c", "ContactId", @SubscriberKey)]%%

Your Answer

Interviews

Parent Categories