TransWikia.com

Using Data Binding in Journey Builder Activities

Salesforce Asked by Eliot Harper on December 6, 2021

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?

3 Answers

try this instead

 "{{Contact.Attribute.\"Member Preferences\".Preference}}"

you may need two escapes.

Answered by Bo Wang on December 6, 2021

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"

Answered by kevinfahy on December 6, 2021

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.

Answered by Drew Simmons on December 6, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP