2

I note that in the Data Binding documentation you can use data binding either in a Custom Activity, or in a Journey Builder Activity (created with an Interaction API method).

I'm trying to figure out how to implement this. I note that it's used in conjunction with the InArguments and OutArguments for the Execute method.

What I would like to do is to use a value from my serialized Event data for a Contact record and use it in a subject line for a Send Email Activity.

I'm taking a wild stab in the dark here, but I'm assuming that I include the following in the arguments of the Send Email Activity:

"arguments":{
  "execute":{
     "inArguments":{
        "myCustomSubject":"{{Contact.Attribute.[Member Preferences].[Preference]}}"
     }
  }

This will make myCustomSubject available for use in the Activity. Note that I am binding to Event data stored in a 'Member Preferences' Attribute Set and use the 'Preference' Atrribute for the Contact.

I'm trying to figure out how I can then use this Argument Activity. I would assume that my Activity might look something like this:

{
   "id":"89d8e972-648e-45d9-88ce-ac1b63ef9490",
   "key":"EMAIL-1",
   "name":"Welcome-2015-02-13T042729.094",
   "description":"87D0B809-C04A-458E-A40A-E6259ADAB293",
   "type":"EMAIL",
   "outcomes":[
      {
         "key":"17399107-9f68-411e-bcfb-dda3fb2fc88f",
         "next":"WAIT-3",
         "arguments":{},
         "metaData":{}
      }
   ],
   "arguments":{
      "execute":{
         "inArguments":{
            "myCustomSubject":"{{Contact.Attribute.[Member Preferences].[Preference]}}"
         }
      },
      "emailSubjectDataBound":"{{myCustomSubject}}",
      "contactId":"{{Contact.Id}}",
      "contactKey":"{{Contact.Key}}",
      "emailAddress":"{{Contact.Default.Email}}",
      "sourceCustomObjectId":"{{Contact.AddressInfo.Email.SourceCustomObjectId}}",
      "sourceCustomObjectKey":"{{Contact.AddressInfo.Email.SourceCustomObjectKey}}",
      "fieldType":"{{Contact.AddressInfo.Email.FieldType}}",
      "customObjectKey":"{{Event.CONTACT-EVENT-58f14aa9-6316-abfe-7666-f325b8785674._CustomObjectKey}}"
   },
   "configurationArguments":{
      "emailId":"3629",
      "emailSubject":"{{myCustomSubject}}",
      "sendClassificationId":"E269D976-155B-E411-AEA6-38EAA71427A1",
      "senderProfileId":"",
      "isMultipartMime":true,
      "preheader":""
   },
   "metaData":{}
}

This doesn't work though. Please can someone point me in the right direction?

2

What you should do is follow this example and use AMPscript in your subject.


"inArguments":[
    { "firstName":"{{Contact.Attribute.__your-de-name__.FirstName}}"},
    { "lastName":"{{Contact.Attribute.__your-de-name__.LastName}}"},
    { "emailAddress": "{{Contact.Default.Email}}"}                          
],

When you fire the event, you can pass data into the DE to be saved. Your custom activity can receive inArgument data to be used within the custom activity. A standard activity like Send Email can pull in DE data via AMPscript.

Also, see this question/answer/comments for more information.

  • do you have an example where you pass an array of values instead of a single value? example list of the last 3 emails names opened stored in a DE that I prepared for this purpose. I'm having a hard time figuring out the correct template structure. – Bechir Nov 6 '19 at 13:38
2

Ran into a similar issue - the documentation is a bit confusing. We shouldn't include square brackets when using databinding, so your inArguments should look like (assuming JSON):

"inArguments": {
  "myCustomSubject": "{{Contact.Attribute.\"Member Preferences\".Preference}}"
}

(Quotes around "Preference" are optional, since it has no whitespace.)

In the data binding documentation, they write:

Example: Contact.Attribute.["Product Orders"].["Product Name"]

Which is confusing, because they use the square brackets to indicate a variable, but they are supplying actual strings in place of variables. The documentation should probably be changed to:

Example: Contact.Attribute."Product Orders"."Product Name"

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.