1

I've got a triggered send which adds values to a data extension. the data extension then feeds into a journey which sends emails. each email has the following code:

%%[

VAR @futureDate, @today, @formattedDate, @timestamp, @subLanguage, @result, @url_yes
SET @today = Now(1) 
SET @timestamp = Format(@today, 'yyyy-MM-dd')
SET @futureDate = DateAdd(@today, 27, 'D')
SET @formattedDate = Format(@futureDate,'yyyy-MM-dd')

Set @subLanguage= RetrieveSalesforceObjects('MAG_Subscription__c', 'MAG_Language__c', 'Id', '=', 'SubscriptionID')

set @url_yes = Concat('https://pub.s7.exacttarget.com/0tifupaskin?sk=','SubscriptionID','&ln=',@subLanguage,'&expiry=',@formattedDate)

SET @result = UpdateSingleSalesforceObject('MAG_Subscription__c','SubscriptionID','MAG_VerifiedRequestDate__c', @timestamp)

]%%

the value that i want to reference is called SubscriptionID but it doesn't seem to work. I thought that because the DE is feeding the journey i have access to its data or do I need to call it in some way. Currently, the email doesn't send because something is wrong with the code.

Thanks as always for your help :)

1

Figured it out. Should've use AttributeValue.

 <!--%%[

VAR @futureDate, @today, @formattedDate, @timestamp, @subLanguage, @result, @url_yes, @subID, @rowCount, @subscriptionRow, @subscription
SET @today = Now(1) 
SET @timestamp = Format(@today, 'yyyy-MM-dd')
SET @futureDate = DateAdd(@today, 27, 'd')
SET @formattedDate = Format(@futureDate,'yyyy-MM-dd')

SET @subID = AttributeValue('SubscriptionID')

SET @subscription = RetrieveSalesforceObjects('MAG_Subscription__c', 'MAG_Language__c', 'Id', '=', @subID)
SET @rowCount = rowCount(@subscription)
IF @rowCount > 0 THEN
    SET @subscriptionRow = Row(@subscription, 1)
    SET @subLanguage = FIELD(@subscriptionRow, 'MAG_Language__c')

ENDIF

SET @url_yes = Concat('https://pub.s7.exacttarget.com/0tifupaskin?sk=',@subID,'&ln=',@subLanguage,'&expiry=',@formattedDate)

SET @result = UpdateSingleSalesforceObject('MAG_Subscription__c',@subID,'MAG_VerifiedRequestDate__c', @timestamp)

]%%-->

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.