0

I'll appreciate your help,

  1. We have already established MC connect to our client's CRM (SF Sales).

  2. In the CRM, we have an Object that is connected to a second object.

  3. We want that a certain change in one of the second object's fields (let's say a date for an appointment is set) will act as a trigger for a certain contact (which is connected only to the first object) to be added to a journey in SFMC.

  4. We can do that using query of course, but when trying to achieve it using journey builder interface and "salesforce data entry source" we cannot "reach/see" that contact.

are we missing something, or must there be adaptations from the CRM side otherwise query are the only option?

thanks!

nizan

0

You can also use the API entry for the Journey in Marketing cloud. But NOTE that you may need to write custom APEX code in Sales cloud to trigger as below.

Sales/Service cloud:

By using Future class, pass the parameters to the Marketing cloud's Landing page. Make sure to include the 18-digit Contact/Lead ID.

Marketing cloud Fire Entry to Journey

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

Example cloudpage code:

<!-- Processing page : START -->
%%[
SET @subkey = QueryParameter('subkey')
SET @FirstName = QueryParameter('FirstName')
SET @email = QueryParameter('email')
   /*Generating the AccessToken using client id and secret key*/
   VAR @callstatus, @response
   SET @payload = '{"client_id": "xxxxxx", "client_secret": "xxxxxxx", "grant_type": "client_credentials"}'
   SET @accessToken = HTTPPost2("https://xxxxxxxxxxxx.auth.marketingcloudapis.com/v2/token", "application/json", @payload, True, @callstatus, @response)
   ]%% 
   <script runat="server">
   /*Framing the API content and extracting only access token from the above response*/
   Platform.Load("core", "1");
   var subkey = Variable.GetValue("@subkey");
   var FirstName = Variable.GetValue("@FirstName");
   var email = Variable.GetValue("@email");
   var accessTok = Variable.GetValue("@callstatus");
   var response_ = Platform.Function.ParseJSON(accessTok);
   var accessToken_ = response_.access_token;
   var content = { "ContactKey": subkey, 
       "EventDefinitionKey":"xxxxxxx", 
       "EstablishContactKey": true, 
       "Data": { 
          "email address": email,
          "FirstName":FirstName,
          "Contact Key":subkey }}
   var strContent = Platform.Function.Stringify(content);
   Variable.SetValue("@token_",'Bearer '+accessToken_); 
   Variable.SetValue("@content",strContent);
   </script>
   %%[
   /*Invoking the journey API*/
   var @statusCode
   var @response
   SET @post = HTTPPost2("https://xxxxxxxxxx.rest.marketingcloudapis.com/interaction/v1/events","application/json",@content,false,@statusCode, @response, "Authorization", @token_)
 ]%%
 %%=v(@token_)=%% <br/>
 %%=v(@statusCode)=%% <br/>
 %%=v(@content)=%%<br/>
<!-- LIVE:: Processing page : END -->

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.