I have a journey set up using Salesforce Data as the entry source. There's a "Send SMS" step in the journey where I need to be able to pull a specific field out of that object to display in the SMS message. My understanding is we cannot use dynamic content from the Salesforce Data entry source the same way we can use dynamic content from a data extension.

Normally, I would use something like this when dealing with data extensions. Notice the variable [StopLevelUrl].

set @concatString = concat('{"originalURL":','"',[StopLevelUrl],'",','"domain": "cswg.shortcm.li"}')
set @response = HTTPPost2('https://api.short.cm/links','application/json', @concatString, 'true', @output, @responseHeader, 'Authorization', 'abcdefghijklmnop')
set @shortUrl = substring(@output, add(indexof(@output, 'secureShortURL'),17), 30)
Delivery Alerts: We're on it! Your delivery from <FAC> is arriving today. Click here to track: %%=v(@shortUrl)=%%

But, [StopLevelUrl] cannot be used since I am using Salesforce Data as the entry source, even though StopLevelUrl is in fact a field on the Salesforce Object.

I am going down the route of using "RetrieveSalesforceObjects" to see if that will work.

set @rs = RetrieveSalesforceObjects('Subscriber_Delivery_Update__c', 'ID, Name, Stop_level_URL__c, Locale__c', 'Contact__c', '=', SubscriberKey, 'Name', '=', 'SOMETHING HERE')

Notice "SubscriberKey" - this should work in the SMS message. This will get records from the Salesforce object "Subscriber_Delivery_Update__c" where the ContactKey is equal to the SubscriberKey. Now, I need to further narrow that down because the goal is to just have a single record returned where I can pull out StopLevelUrl. If I leave it as is, I'll get around 157 records.

Question: is there any way to identify the current record being injected into the journey coming from Salesforce Data so that I can properly call "RetrieveSalesforceObjects" to get the current record?

  • What if you queried the Synchronized Data Extension into a regular data extension to use [StopLevelUrl]? – Jackson Chen Apr 4 at 22:23
  • 1
    Thing is, @JacksonChen, the idea of using Salesforce Data is real time. Needs to be real time, so using a query would rely on an automation studio schedule. – Mike Marks Apr 5 at 12:50
  • Otherwise yes, that would work very well – Mike Marks Apr 5 at 12:50
  • I agree with you @MikeMarks that it should be real-time, which is why I didn't want to put querying the Synchronized DE as an answer – Jackson Chen Apr 5 at 16:01
  • 1
    That make sense @MikeMarks since the Salesforce Data is the entry source. – Jackson Chen Apr 5 at 16:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.