ValueText Help Articles

Create Message Bucket Records in Salesforce from SFMC

Message From SFMC

Description:

You can create message bucket record in Salesforce Marketing Cloud by using the below options.

      Option 1: Via Journey Builder

1. Create a simple journey with one activity. Drag and drop the “Object Activity” from the activity list onto the canvas.

2. Start configuring the ‘Object Activity’ by clicking on it. In the ‘Select Object’ step, search for the object ‘Message Bucket’ and select.

3. Through this activity, you are just trying to ‘create’ a ‘Message Bucket’ record in Sales cloud. Here choose, ‘Create New’ as the action.

4. In the ‘Map Fields’ step, select the fields that need to be mapped to create a Message Bucket record. Here it displays all the available fields in ‘Message Bucket’ object.

5. Select ‘Number (To Phone)’ field. This is the message recipient phone number. From the right side menu, you can then simply select the phone number field from the Journey data extension. (In this example, the data extension field for phone number is Mobile_Phone__c).

6. Similarly select the ‘Account’ field in Message Bucket and map it to the corresponding field in the data extension.

7. Repeat the mapping until all of these fields are mapped. All the six fields need to be mapped.

    1. Sender ID (From) – This is the From Mobile Number. We can manually type in the values too instead of mapping with a corresponding data extension field.
    2. Template ID – Manually enter the WhatsApp template ID
    3. Related To – ID of the related object record.
    4. Requested Channel – Manually enter this as ‘WhatsApp’.

8. You’d have this single step journey created. The data extension should contain the target customer records with all the fields required for the mapping.

Notes:

  1. Journey builder object activity doesn’t leverage Bulk API.
  2. It processes the records slowly in cycles about a few hundred records per minute.
  3. It is easy to configure the object activity though and can be used for low volumes of Message bucket creation.
  4. Journey builder activity uses Marketing Cloud Connect to update in Salesforce, so this doesn’t consume the Salesforce API limits.
      Option 2: Via SFMC Scripts (Salesforce Bulk API 2.0)

Using Salesforce Bulk API 2.0 with custom SSJS scripts in Automation Studio, you’ll be making API calls to Salesforce to insert Message Bucket records.

Notes

a. Bulk API 2.0 request can send upto 150,000,000 records (150 Million) in a 24-hour period with Max data size of 150MB per request.

b. Process up to 10k records in a batch. This will be 1 API call.

c. This does consume API calls outside of the Connector based Connected App Authentication.

d. For one million updates it would be just 100 calls ( and additional couple of calls for authentication and opening/closing of batch job).

Bulk API Flow

  1. Create a job that defines ‘creation’ of records.
  2. Push batches of data into the job that Salesforce then processes.
  3. Repeat with batches of up to 10k records.
  4. Close the job.


      Option3: Via Journey Builder Custom Activity (Salesforce BULK/REST API)

Currently custom activity calls external vendor WhatsApp API.

The custom activity can be updated to change the API call to Salesforce endpoint instead.

Using Salesforce BULK/REST API, a Message Bucket record can be created in Salesforce by simply calling the Salesforce endpoint.

Salesforce provides REST API to create a record in Salesforce.

Salesforce REST Endpoint URL

https://MyDomainName.my.salesforce.com/services/data/v59.0/sobjects/Message_Bucket__c/

Request to create Message Bucket record in Salesforce

{

  “Sender_ID__c” : “XXXXX”

  ” Number (To Phone)” : “XXXXX”

  ” Related_To__c ” : “002XXXXXXX “

  ” Requested_Channel __c ” : “WhatsApp”

  ” Account” : “002XXXXXXX”

  ” Template_ID__c ” : “T0012”

}

Response 

{

  “id” : “001D000000IqhXXXXX”,

  “errors” : [ ],

  “success” : true

}

      Option4: After Custom Activity (Salesforce BULK/REST API)

Amend the current custom activity to obtain the Template ID and store in a Data extension.  Slightly complex.

Then using the “Object Activity” to create “Message Bucket” record creation (similar to Option 1)

Follow Us

Email: sales@valuetext.io ,
Address: 
B103, Kalpataru, Erragadda, Hyderabad, 500018

© 2022 ValueText. All rights reserved