2

I am working on custom activity in Journey builder where, I need to access the values of the fields from Data Extension as inArguments. I read about data binding from here and used the below syntax to access data extension field values:

{{Contact.Attribute.DE_NAME.FirstName}}

But, I receive empty string in the FirstName field and I am sure there is value present for this field in DE.

config.json

{
  "workflowApiVersion": "1.1",
  "metaData": {
    "icon": "img/img_1.png",
    "iconSmall": "img/img_2.png",
    "category": "message"
  },
  "type": "REST",
  "lang": {
    "en-US": {
      "name": "Test custom activity",
      "description": "Testing custom activity"
    }
  },
  "arguments": {
    "execute": {
      "inArguments": [
        {
          "firstName": "{{Contact.Attribute.DE_NAME.FirstName}}"
        },
        {
          "lastName": "{{Contact.Attribute.DE_NAME.LastName}}"
        },
        {
          "emailAddress": "{{Contact.Default.Email}}"
        }
      ],
      "outArguments": [],
      "url": "https://xyz.ngrok.io/activities/execute",
      "verb": "POST",
      "body": "",
      "header": "",
      "format": "json",
      "useJwt": false,
      "timeout": 10000
    }
  },
  "configurationArguments": {
    "applicationExtensionKey": "test-activity-custm-wwq",
    "defaults": {
      "activity": "0"
    },
    "save": {
      "url": "https://xyz.ngrok.io/activities/save",
      "useJwt": false
    },
    "publish": {
      "url": "https://xyz.ngrok.io/activities/publish",
      "verb": "POST",
      "body": "",
      "useJwt": false
    },
    "validate": {
      "url": "https://xyz.ngrok.io/activities/validate",
      "verb": "POST",
      "body": "",
      "useJwt": false
    },
    "stop": {
      "url": "https://xyz.ngrok.io/activities/stop",
      "useJwt": false
    }
  },
  "wizardSteps": [
    {
      "label": "Select anything",
      "key": "1"
    },
    {
      "label": "Confirm Settings",
      "key": "2"
    },
    {
      "label": "Save Settings",
      "key": "3",
      "active": false
    }
  ],
  "userInterfaces": {
    "configModal": {
      "height": 250,
      "width": 600,
      "fullscreen": false
    }
  }
}

Received inArguments in Execute API :

{"inArguments"=>[{"firstName"=>""}, {"lastName"=>""}, {"emailAddress"=>"testemail+62@gmail.com"}]

Is anything I am doing wrong, please help me.

Thanks..

4
  • 2
    Are these values part of the entry event and therefore available via event data? If not, is the data extension correctly linked to an attribute group in contact builder? Jun 26, 2017 at 8:52
  • @MarkusSlabina, Thanks, I missed it. Now, I can get the values of the Data Extension fields after creating a population in Data designer by linking a field in DE with the Contact Key.
    – Gokul
    Jun 26, 2017 at 11:31
  • Please post it as an answer, So, others can easily find the solution.
    – Gokul
    Jun 26, 2017 at 11:32
  • Glad I could help! Just added everything to an answer. Jun 26, 2017 at 11:37

1 Answer 1

6

If those values are part of the entry event, you can access them using the following expression:

{{Event.<YOUR ENTRY EVENT DEFINITION KEY>.\"<EVENT DATA ID PATH>\"}}

If not, you need to link the data extension correctly to an attribute group in contact builder, for it to be available for data binding in the arguments of your custom activity. In that case your expression is correct.

Related documentation:

Code Example:

10
  • Hi Markus, could you show an exact string for the entry event that will be rendered at the runtime? {{Event.<YOUR ENTRY EVENT DEFINITION KEY>.\"<EVENT DATA ID PATH>\"}} Is it like { "FirstName":"{{Event.TEST_CUSTOM_EVENT_AUTOMATION_STUDIO.\"TEST_CUSTOM_EVENT_DE.FirstName\"}}" } I am struggling with getting the inArguments values of the entry event
    – Eduard
    Jul 25, 2017 at 11:06
  • As I don't know your event definition key and data path this is a bit hard, but you can see this in the referenced article How Data Binding works. An example is: {{Event.my-custom-product-entry-event-key.ProductId}}. I'm using it for a Salesforce Data Event and looking up data from one of my custom objects in Service cloud. In that case passing the Id of this object looks like this: {{Event.my-sf-entry-event-key.\"CustomObject__c:Id\"}} The last part is the column name in the event's DE. Jul 25, 2017 at 11:22
  • Thanks for quick reply! Event definition key: 'TEST_CUSTOM_EVENT_AUTOMATION_STUDIO'. DE external key that is connected with event: 'TEST_CUSTOM_EVENT_DE'. Field (Text, 100) in DE I want to retrieve: 'FirstName'. But still I cannot get a value in inArguments payload. Basically I created a journey in MC, created a Contact Data Entry Event. I know it will be deprecated, but I use it temporary for testing purposes, i.e. firing an event from Automation Studio, it's much easier to inject contacts into a journey.
    – Eduard
    Jul 25, 2017 at 11:25
  • If you only wan't to pass data from the entry event directly (as you are using a contact data entry event) this could be done using {{Event.TEST_CUSTOM_EVENT_AUTOMATION_STUDIO.FirstName}}. Jul 25, 2017 at 11:28
  • I have created a new question to discuss this issue - link
    – Eduard
    Jul 25, 2017 at 11:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .