RetrieveSalesforceJobSources

This function returns details of a Marketing Cloud send job to a Salesforce audience. It returns a row set containing the following fields:

Field Description
SourceID ID of the data source in Sales Cloud
SourceType Type of source in Sales Cloud (for example, Report or Campaign)
IsInclusionSource Boolean value indicating audience is an inclusion source

NOTE: The function does not return the status of the job and therefore should not be used to validate that an email send has been completed.

Argument

RetrieveSalesforceJobSources(1)

Ordinal Type Required Description
1 Number True JobID of the Salesforce send

Example

%%[

var @jobId, @rows, @row, @rowCount

set @jobId = 40029164
set @rows = RetrieveSalesforceJobSources(@jobid)
set @rowCount = rowcount(@rows)

if @rowCount > 0 then

  for @i = 1 to @rowCount do

      var @SourceID
      var @SourceType
      var @IsInclusionSource

      set @row = row(@rows, @i)
      set @SourceID = field(@row, "SourceID")
      set @SourceType = field(@row, "SourceType")
      set @IsInclusionSource = field(@row, "IsInclusionSource")

      output(concat("SourceID: ", @SourceID))
      output(concat("<br>SourceType: ", @SourceType))
      output(concat("<br>IsInclusionSource: ", @IsInclusionSource))

  next @i

else

  output(concat("No rows for ", @jobId, " found"))

endif

]%%

Output

SourceID: 00O50000003JaFnEAK
SourceType: Report
IsInclusionSource: True