0

I am able to pass data from Salesforce to a URL, which is linked to a CloudPage, which is all part of a Triggered Send. What I also want to do is add additional data to the DE apart from the default SubscriberKey and Email. This is from the same object used to build the Triggered Send.

 %%[
VAR @futureDate, @today, @url, @subRecordId, @subLanguage, @subscription, @subscriptionRow, @mySObject, @rowCount, @contactID
SET @today = Now(1) 
SET @futureDate = DateAdd(@today, 90, "D")
SET @formattedDate = Format(@futureDate,"yyyy-MM-dd")

Set @mySObject = AttributeValue("SObject")
SET @subRecordId = AttributeValue("RecordId")

SET @subscription = RetrieveSalesforceObjects(@mySObject,"MAG_Language__c, MAG_Contact__c","Id", "=", @subRecordId)
SET @rowCount = rowCount(@subscription)

IF @rowCount > 0 THEN

    SET @subscriptionRow = Row(@subscription, 1)
    SET @subLanguage = FIELD(@subscriptionRow, "MAG_Language__c")
    SET @contactID = FIELD(@subscriptionRow, "MAG_Contact__c")

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

UpdateDE("TriggeredSendDataExtension",1,"SubscriberKey",@contactID,"SubID",@subRecordId)

]%%

I've tried UpdateData() instead of UpdateDE() with no luck.

  • what error do you get? – Gortonington Oct 2 '18 at 12:46
  • Also does the target DE have SubscriberKey as the primary key? There needs to be a matching primary key in order to update. – Gortonington Oct 2 '18 at 12:48
  • the SubID doesn't get populated. When creating a DE with the template of TriggeredSendDataExtension, you cannot make the SubscriberKey Primary. – neo2049 Oct 2 '18 at 13:55
  • That is correct, which is why you cannot update info inside of a TriggeredSendData Extension - you can only overwrite. Your best bet is to copy these into another DE (I usually use SubKey and InsertDate as Pkeys if you want to allow more than one instance of a send) and then update the info inside that DE and use that as the primary resource. – Gortonington Oct 2 '18 at 14:05
  • Ok scratch the earlier comment. The email doesn't even send. Created a case with Salesforce. – neo2049 Oct 3 '18 at 8:15

Your Answer

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

Browse other questions tagged or ask your own question.