RetrieveSalesforceJobSources()

Returns a rowset that contains information about a send. The rowset contains the SourceID, SourceType, and IsInclusionSource values from the specified job ID. The function doesn’t output any information about the status of the job itself. It returns data even if the job was canceled, so we recommend that you don’t use this function to test whether a job completed.

Availability 

Marketing Cloud Engagement ✅ Yes
Marketing Cloud Next ❌ No

Syntax 

1RetrieveSalesforceJobSources(jobId)

The RetrieveSalesforceJobSources() function has one parameter:

  • jobId (number): Required. The job ID of the Salesforce send to retrieve information about.

Usage 

To use this function, pass it the numeric job ID of a Salesforce send.

1%%[
2var @jobId, @jobData, @row, @rowCount
3
4set @jobId = 90492034
5set @jobData = RetrieveSalesforceJobSources(@jobId)
6
7for @counter = 1 to rowCount(@jobData) do
8  var @sourceID
9  var @sourceType
10  var @isInclusionSource
11
12  set @rowData = row(@jobData, @counter)
13  set @sourceID = field(@rowData, "SourceID")
14  set @sourceType = field(@rowData, "SourceType")
15  set @isInclusionSource = field(@rowData, "IsInclusionSource")
16]%%
17
18  <p>SourceID: %%=v(@sourceID)=%%</p>
19  <p>SourceType: %%=v(@sourceType)=%%</p>
20  <p>IsInclusionSource: %%=v(@isInclusionSource)=%%</p>
21
22%%[ next @counter ]%%

The function outputs the SourceID, SourceType, and IsInclusionSource values for each row in the rowset.