Skip to main content
fix title, grammar
Source Link
Adam Spriggs
  • 31.1k
  • 6
  • 44
  • 88

script activity automation SalesForce Marketing cloud Update Salesforce object with a Script Activity

I would like to create a script activity in an automation in order to update a SalesSalesforce Object.

thisHere is an exemple ofmy example script, how. How can i update this script to beI get it accepted as A SSJS script in script activitythe Script Activity?

%%[

var @rowCount
set @rowCount = DataExtensionRowCount("ENT.My_DE")

var @nmaratasDE, @rsRow, @i, @Contact_ID, @PhoneNumber
SET @nmaratasDE = LookupRows("nmaratasDE")

IF RowCount(@nmaratasDE) > 0 THEN 

 FOR @i = 1 to RowCount(@nmaratasDE) DO 

   SET @rsRow = Field(Row(@nmaratasDE, @i))
   SET @Contact_ID = Field(@rsRow, "ContactID")
   SET @PhoneNumber = Field(@rsRow, "MobileNumber")

 

)
 
    
set @result = UpdateSingleSalesforceObject('IN_Contact__c', @Contact_ID, Phone_Num_c, @PhoneNumber)
 

]%%

script activity automation SalesForce Marketing cloud

I would like to create a script activity in automation in order to update a Sales Object.

this is an exemple of script, how can i update this script to be accepted as A SSJS script in script activity?

%%[

var @rowCount
set @rowCount = DataExtensionRowCount("ENT.My_DE")

var @nmaratasDE, @rsRow, @i, @Contact_ID, @PhoneNumber
SET @nmaratasDE = LookupRows("nmaratasDE")

IF RowCount(@nmaratasDE) > 0 THEN
FOR @i = 1 to RowCount(@nmaratasDE) DO
SET @rsRow = Field(Row(@nmaratasDE, @i))
SET @Contact_ID = Field(@rsRow, "ContactID")
SET @PhoneNumber = Field(@rsRow, "MobileNumber")

 

)
 

set @result = UpdateSingleSalesforceObject('IN_Contact__c',@Contact_ID,Phone_Num_c,@PhoneNumber)
 

]%%

Update Salesforce object with a Script Activity

I would like to create a script activity in an automation to update a Salesforce Object.

Here is my example script. How can i update I get it accepted as A SSJS script in the Script Activity?

%%[

var @rowCount
set @rowCount = DataExtensionRowCount("ENT.My_DE")

var @nmaratasDE, @rsRow, @i, @Contact_ID, @PhoneNumber
SET @nmaratasDE = LookupRows("nmaratasDE")

IF RowCount(@nmaratasDE) > 0 THEN 

 FOR @i = 1 to RowCount(@nmaratasDE) DO 

   SET @rsRow = Field(Row(@nmaratasDE, @i))
   SET @Contact_ID = Field(@rsRow, "ContactID")
   SET @PhoneNumber = Field(@rsRow, "MobileNumber")

)
    
set @result = UpdateSingleSalesforceObject('IN_Contact__c', @Contact_ID, Phone_Num_c, @PhoneNumber)

]%%
Source Link
Ab Fly
  • 51
  • 2
  • 6

script activity automation SalesForce Marketing cloud

I would like to create a script activity in automation in order to update a Sales Object.

this is an exemple of script, how can i update this script to be accepted as A SSJS script in script activity?

%%[

var @rowCount
set @rowCount = DataExtensionRowCount("ENT.My_DE")

var @nmaratasDE, @rsRow, @i, @Contact_ID, @PhoneNumber
SET @nmaratasDE = LookupRows("nmaratasDE")

IF RowCount(@nmaratasDE) > 0 THEN
FOR @i = 1 to RowCount(@nmaratasDE) DO
SET @rsRow = Field(Row(@nmaratasDE, @i))
SET @Contact_ID = Field(@rsRow, "ContactID")
SET @PhoneNumber = Field(@rsRow, "MobileNumber")



)


set @result = UpdateSingleSalesforceObject('IN_Contact__c',@Contact_ID,Phone_Num_c,@PhoneNumber)


]%%