I have written a custom activity to extract data from my DE and send sms through a third party sms vendor. Here is the snippet from config.json

"arguments": {
    "execute": {
        "inArguments": [
                "phoneNumber": "{{Contact.Attribute.Test_Extension_PhoneNumber.Phone}}"
        "outArguments": [],
        "url": "https://some-text-here-sms.herokuapp.com/execute"

Now the problem is this activity will only run for the Data extenstion with name 'Test_Extension_PhoneNumber'. I want to make this generic(something like %%Data_extension_name) and it should send data from any data extension that is selected while building the journey. I have same headers but different Data extensions for running different campaigns. Is this feasible?

  • understanding question, You need that the user selects the data extension within the Custom Activity UI in a list and click save, is that correct? – Bechir Nov 6 '19 at 8:34
  • @Bechir Yes, that's correct. And after getting saved when it is executed, my api "some-text-here-sms.herokuapp.com/execute" should receive the data under the header 'Phone' for that particular Data extension. – Avishek Ghosh Nov 6 '19 at 8:47
  • Why do you need to send SMS from different Data extensions? is the subscriber supposed to have different mobile numbers in your system? – Bechir Nov 6 '19 at 8:58
  • @Bechir For example: If we need to send 5 types of SMS at the same time to different customers, then we will need 5 different DE. – Avishek Ghosh Nov 6 '19 at 10:28
  • I understand your issue now, you don't need different DE for different SMS sends. please check answer below. – Bechir Nov 6 '19 at 11:01

If you want to use data from event source data extension dynamically please check my answer here:


With some modifications you will be able to use any type of entry source, so all data will appear as part of payload.


enter image description here

1- create an Attribute Group in Data Designer for your SMS CustomActivity in order to facilitate data biding in Journey builder (more on that in Step 8) in this example I will name the Attribute group "SMSCustomActivity"

Reference: https://help.salesforce.com/articleView?id=mc_cab_create_an_attribute_group.htm&type=5

enter image description here

2- Create a Data extension where you pull required information for your SMS sending (Name, mobileNumber ...)

3- connect The new data extension with Your contact Data model (Contact Key)

enter image description here

4- save everything

5- populate your DE with the users with valid MobileNumber

6- In journey builder, you can have multiple instances of your custom activity, enter image description here

7- each one with a different text that you can edit and save. (Marketing Cloud is able to save your custom activity Payload)

enter image description here

-8 Than it's up to you to send Data to your custom activity server in the following format (Notice the Attribute Group name use)

                "mobile":  "{{Contact.Attribute.SMSCustomActivity.MobileNumber}}",
                "FirstName":  "{{Contact.Attribute.SMSCustomActivity.FirstName}}",
                "LastName":  "{{Contact.Attribute.SMSCustomActivity.LastName}}"

9- every contact entrering your Journey will be identified in the SMSCustomActivity Attribute Group and his data will be sent to your custom activity endpoint.

Important: The SMSCustomActivity Attribute group is to simplify data access from Journey builder, Make sure to populate your Data extension with an Automation or with a couple of records manually for testing.

You can always access contact data the way below, but for clarity, I suggest to have Attribute groups with specific use-cases.

                "emailAddress": "{{Contact.Default.Email}}"}
  • Thanks a lot for this but this will take care of the campaigns for a single day but since every day campaign name changes, we'll have to create a new journey every day. We can't have the same filter for every journey. Thus, it requires manual effort daily. Also, the campaigns run in automation studio won't be managed here as the content for the message is coded in AMPscript which is a limitation for journey builder as well as custom activity. – Avishek Ghosh Nov 7 '19 at 8:53
  • Hi, your question is clearly about Journey builder custom activity. For Automation studio, you will have to post a new question with more details in that regard. – Bechir Nov 7 '19 at 9:35

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.