Accessing Entry Event Data – Journey Builder Custom Activity

Background

I am developing a simple custom activity for JB. There are lots of gotchas apparently. I have read the following sources from cover to cover and still cannot make it all together:

How Data Binding Works

Accessing Data Extension field values

Accessing subscriber profile attribute values

I need to access the values of the fields from Data Extension as inArguments. This Data Extension is linked to the Journey Entry Event. Hence I should be accessing entry event attributes basically.

I created a journey, added an Entry Source of type “Contact Data Entry Event”. Data Extension I am trying to pull data from is linked to this Entry Event.

Entry Source Name: TEST_CUSTOM_EVENT_AUTOMATION_STUDIO

enter image description here

enter image description here

Data Extension External Key: TEST_CUSTOM_EVENT_DE

Data Extension field name: FirstName

enter image description here

config.json:

     "arguments": {
         "execute": {
            "inArguments": [
                 { "Contact.Key":"{{Contact.Key}}" },
                 { "FirstName":"

{{Event.TEST_CUSTOM_EVENT_AUTOMATION_STUDIO.FirstName}}"
 },
                 { "FirstName":"Test" }
             ],
             "outArguments": [
             ],
             "url": "https://zapier-jb-test.herokuapp.com/jb/activities/send-to-zapier/execute/",
             "verb": "POST",
             "body": "",
             "header": "",
             "format": "json",
             "useJwt": false,
             "timeout": 10000
         }
     },

Received inArguments in Execute API :

{  inArguments: [ 
    { 'Contact.Key': 'customevent1' },
    { FirstName: '' },
    { FirstName: 'Test' },
], ...}

Question

How can I access these data?

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

I found where the bug was. I should have used the “real” EVENT DEFINITION KEY instead of its NAME. When you are in a journey you won’t see this value. For this you need to go to Entry Sources and find your Event there.

enter image description here

So now it works!

config.json:

     "arguments": {
         "execute": {
            "inArguments": [
                 { "Contact.Key":"{{Contact.Key}}" },
                 { "FirstName":"{{Event.ContactEvent-72af1529-1d7d-821e-2a08-34fb5068561d.FirstName}}" }
             ],
             "outArguments": [
             ],
             "url": "https://zapier-jb-test.herokuapp.com/jb/activities/send-to-zapier/execute/",
             "verb": "POST",
             "body": "",
             "header": "",
             "format": "json",
             "useJwt": false,
             "timeout": 10000
         }
     },

And the API Output:

{  inArguments: [ 
    { 'Contact.Key': 'customevent1' },
    { FirstName: 'Foo1' }
], ...}


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x