1

I'm having an issue with chaining two Custom Journey Builder Activities together.

In my first activity I have

outArguments

 "outArguments": [{
                    "PUSH_TOKEN_ID": "",
                    "PUSH_DATE": "",
                    "PUSH_SEGMENT_NAME": ""
                }],

Schema

"schema": {
            "arguments": {
                "execute": {
                    "outArguments": [{
                            "PUSH_TOKEN_ID": {
                                "dataType": "text",
                                "isNullable": false,
                                "direction": "out",
                                "access": "visible"
                            }
                        },
                        {
                            "PUSH_DATE": {
                                "dataType": "date",
                                "isNullable": false,
                                "direction": "out",
                                "access": "visible"
                            }
                        },
                        {
                            "PUSH_SEGMENT_NAME": {
                                "dataType": "text",
                                "isNullable": false,
                                "direction": "out",
                                "access": "visible"
                            }
                        }
                    ]
                }
            }
        }

And in my second activity I have as part of my schema:

"schema": {
            "arguments": {
                "execute": {
                    "inArguments": [{
                        "PUSH_DATE": {
                            "dataType": "date",
                            "isNullable": false,
                            "direction": "in",
                        }
                    },
                    {
                        "PUSH_SEGMENT_NAME": {
                            "dataType": "text",
                            "isNullable": false,
                            "direction": "in",
                        }
                    },
                    {
                        "PUSH_TOKEN_ID": {
                            "dataType": "text",
                            "isNullable": false,
                            "direction": "in",
                        }
                    }]
                }
            }

The issue I'm having with this is when I try and add the values from the first activity in the second activity and try and "Test" or "Activate" then I get the error

Activity REST-2 of type REST has an argument PUSH_TOKEN_ID which is not a valid argument Activity REST-2 of type REST has an argument PUSH_DATE which is not a valid argument Activity REST-2 of type REST has an argument PUSH_SEGMENT_NAME which is not a valid argument

Can anyone tell me what the issue could be?

Part 2

for(var i = 0; i < schema.schema.length; i++)
        {
            if(schema.schema[i].access != "Hidden")
            {
                var fieldKey = schema.schema[i].key;
                var argName = fieldKey.split('.')[2];

                toJbPayload['arguments'].execute.inArguments[0][argName] = "{{" + fieldKey + "}}";
            }
        }

1 Answer 1

1

You need to declare arguments from previous Custom Activities using Data Binding in the Interaction Context: Interaction.[ActivityCustomerKey].[OutArgument-Name].

In your scenario, it appears that your first Activity has been assigned the Activity Customer Key 'REST-1', so use:

  "arguments":{  
     "execute":{  
        "inArguments":[  
           {  
              "PUSH_DATE":"{{Interaction.REST-1.PUSH_DATE}}"
           },
           {  
              "PUSH_SEGMENT_NAME":"{{Interaction.REST-1.PUSH_SEGMENT_NAME}}"
           },
           {  
              "PUSH_TOKEN_ID":"{{Interaction.REST-1.PUSH_TOKEN_ID}}"
           }
        ]
     }
  }

Also, refer to this example on my GitHub repo of a working config.json file that is used to get arguments from a previous Activity.

4
  • If you refer to my second part of the code in my question "Part 2" you'll see what I'm doing to populate the inArgs with the correct values - this should work right? But it's still throwing the error.
    – Amtera
    Commented Jul 23, 2017 at 14:18
  • You should not need to define a schema in your second Custom Activity. In your first Custom Activity, you will need to define the data types, for example: "outArguments": [{"PUSH_TOKEN_ID": "number", "PUSH_DATE": "date", "PUSH_SEGMENT_NAME": "string"}], Commented Jul 24, 2017 at 0:56
  • Unfortunately that doesn't work either - I still receive the error
    – Amtera
    Commented Jul 24, 2017 at 12:19
  • I think we would make more progress if we take this offline and have a brief webinar to review your custom activity. You can me an email at eliot.harper[at]salesforcemvps.com to schedule a convenient time. Commented Jul 24, 2017 at 23:14

You must log in to answer this question.

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