4

I am developing a Journey Builder Custom Activity, in one of the steps on Custom Activity UI, user needs to select a data extension then select a couple of fields. It looks like "UpdateContact" activity in Journey Builder. Does anyone know how to do this?

enter image description here

1 Answer 1

4

Welcome to the club of those who are trying to create custom activities and events for JB.

You will need to use the fuelsdk-node JavaScript library to get a list of all Data Extensions and their fields in a Business Unit. You might want to spend some time and look at an example:

https://github.com/jwalstrom/journey-builder-zapier

In this example you will see how to work with this library. Pay special attention to these files:

  • server.js
  • /lib/sfmc.js
  • /routes/zapier.js
  • /public/activity/zapier/js/activity.js

So you will get a point of how you can use SFMC data in your custom journey.

Probably, you will need to use the REST API resources in case you want to get Contact/Event data:

https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-apis.meta/mc-apis/routes.htm

3
  • Thank you Eduard, it is very helpful. I was wondering how to make API calls in the UI package, even I am not using NodeJS, now I know how to create a .NET application to host the package and use WEB API route to implement SFMC API call. Cheers!
    – Bo Hu
    Oct 3, 2017 at 22:48
  • another question please, when I click the custom activity tile in journey builder, is it possible to pass the REST token from Journey Builder to the activity endpoint? for example, when activity UI loads, load the iframe with "mysite.com/endpoint?accessToken=xxxxx" So we can use that access token to make SFMC api calls, instead of configure it in /config/default.js ( zapier example).
    – Bo Hu
    Oct 3, 2017 at 23:04
  • I have never done it myself, but I suppose it's feasible with JWT. See how it is used in this example. So you just need to retrieve the token and use it somehow with sfmc api calls.
    – Eduard
    Oct 4, 2017 at 13:03

You must log in to answer this question.

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