1

I have a SFMC custom REST activity that fetches data from our internal API and assigns the data to out arguments of my custom REST activity.

I can use a decision split on the out arguments of my custom rest activity however I cannot use the out arguments within another custom rest api body or with a update contact activity. I have tried to use the out arguments within another custom rest api execute body by specifying the format {{Interaction.REST-1.access_token}} like I do with all my journey attributes, however the journey cannot even activate if I specify {{Interaction.REST-1.access_token}}. If I remove the {{Interaction.REST-1.access_token}} then my journey can activate but I require the out argument value.

Does anyone know how I can use REST out arguments within another custom REST activity or within an update contact activity?

1
  • I installed the Postman like journey builder activity from sfmc-postman.com. Its a really powerful and essential tool to have. I have been able to make custom API request in Salesforce Marketing Cloud Journey builder. It works exactly the same as postman. I can also create templates, environment variables and use response variables in my journey. Their analytics is also great. Nov 17, 2021 at 10:25

1 Answer 1

0

Data-binding is the mechanism to consume an outArgument from a previous activity.

For Custom Activity

To consume outArguments, the syntax would be {{Interaction.activityKey.outArgumentField}}

The activityKey can be found manually.

For the manual process, you can get it manually by inspecting the element in devtools of the Journey Data on the settings page in Journey Builder.

enter image description here

For Programmatically you can find by using a postmonger signal called requestInteraction which returns information about the journey itself. This will include every activity on the canvas.

There is a repo here (https://github.com/salesforce-marketingcloud/sfmc-example-jb-custom-activity/blob/master/modules/discount-code/config/config-json.js) that shows both the examples of how to build config files and split and pass arguments.

There is an example of this here

In this example, it actually loads a drop-down list to the user of all activities that have discountCode as an outArgument. The selected value of that drop down is the activitykey that it got from the postmonger signal.So basically it iterates over each activity and inspects the schema specified to find potential outArguments to use from previous activities

For Update Contact Activity

The Update Contact activity does not support selecting from Journey Data natively, but it is possible to manually type in the mustache data binding expression and get the desired result when the contact executes through the activity.

More on data-binding: https://developer.salesforce.com/docs/atlas.en-us.mc-apis.meta/mc-apis/how-data-binding-works.htm

The hard part is knowing the activityKey/outargument field name of previous activities. This can be achieved using some postmonger signals in a custom activity to get metadata about the journey itself

5
  • Hi @Mohith Shrivastava I got the update contact activity working with using {{Interaction.REST-1.access_token}} as the value. However when I use another custom activity in the journey and reference OutArguments from my previous custom activity I cannot even activate my journey when I use the value {{Interaction.REST-1.access_token}} from the previous custom activity. I can however use journey DE values such as Event.DEAudience-58942cb2-9aec-071a-fc07-eef3660ce9ad.SubscriberKey within my second custom activity. Any idea why and if this is possible? Feb 15, 2021 at 13:27
  • Is REST-1 your activity key? Make sure to find your correct activity key? If it is still throwing error open a support case with Salesforce Feb 15, 2021 at 13:36
  • Hi @Mohith Shrivastava, yes REST-1 is my activity key I am 100% sure of it. My contact update activity also works 100% with {{Interaction.REST-1.access_token}} however if I use {{Interaction.REST-1.access_token}} within another custom activity the journey cannot activate and throws an error but no error message. Will support be able to provide information on the backend error why I cannot activate my journey? Feb 15, 2021 at 13:44
  • Yes for sure! Raise a support ticket with all the repro steps and I am sure someone will be able to assist you Feb 15, 2021 at 13:45
  • I installed the Postman like journey builder activity from sfmc-postman.com. Its a really powerful and essential tool to have. I have been able to make custom API request in Salesforce Marketing Cloud Journey builder. It works exactly the same as postman. I can also create templates, environment variables and use response variables in my journey. Their analytics is also great. Nov 17, 2021 at 10:25

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.