Skip to main content

Salesforce Marketing Cloud : Ampscript in 10 Minutes


Salesforce Marketing Cloud

Ampscript in 10 Minutes





Variables


%%[

Var @a

Set @a = 10

]%%

<h1>%%=v(@a)=%%</h1>


Lookup


Lookup("DENAME",

"EmailAddress",

"SubscriberKey", 

@lookupValue)


LookupRows


set @rows = LookupRows("DENAME","flag", true)

set @rowCount = rowcount(@rows)

if @rowCount > 0 then

  for @i = 1 to @rowCount do

    var @emailAddress, @firstName, @rank

    set @row = row(@rows, @i) 

    set @emailAddress = field(@row,"emailAddress")

    ]%%

    <br>emailAddress: %%=v(@emailAddress)=%%

    %%[  next @i ]%%

%%[ else ]%% No rows found %%[ endif ]%%


InsertDE


This function inserts a row in a Data Extension

InsertDE("DENAME",

"EmailAddress", 

@emailAddress,

"SubscriberKey", 

@subscriberKey)


UpdateDE


This function updates the Data Extension 

UpdateDE("DENAME",1,

"EmailAddress", @emailAddress, 

"Update", @updateDate)




RetrieveSalesforceObjects

This function retrieves fields from a record in a Sales or Service Cloud 

standard or custom object.

set @subdetails = 

RetrieveSalesforceObjects(

   "Contact",

   "LastName,Email",

   "Id", "=", _subscriberKey )




UpdateSingleSalesforceObject

This function updates a record in a Sales or Service Cloud 

standard or custom object.

set @updatedetails = 

UpdateSingleSalesforceObject(

      "Contact",

   @Id,

      "LastName", @lastName,

      "Email", @email)




InvokeExecute

Unsubscribe Management - “ Marketing Cloud API

set @er = CreateObject("ExecuteRequest")

SetObjectProperty(@er,"Name","LogUnsubEvent")


set @prop = CreateObject("APIProperty")

SetObjectProperty(@prop, "Name", "SubscriberKey")

SetObjectProperty(@prop, "Value", "_subscriberKey ")

AddObjectArrayItem(@er, "Parameters", @prop)

set @invokeStatusObj = InvokeExecute(@er, 

@invokeStatusMessage, @invokeRequestId)


Comments

Popular posts from this blog

Remote Developer Job Sites

Remote Developer Job Sites 1.  https://angel.co/ 2.  https://turing.com/ 3.  https://www.employremotely.com/ 4.  https://www.upwork.com/ 5.  https://www.freelancer.com/ 6.  https://www.pesto.tech/ 7.  https://www.guru.com/ 8.  https://www.fiverr.com/ 9.  https://remotive.io/ 10. Search Remote Jobs on LinkedIn or other such platforms. 11. Sell Code on  https://codecanyon.net/ Lastly, a viable option could be, you can open your own website, display your work and get your own set of clients.

The Salesforce MasterClass

  Salesforce Master Class 1.0 Overview Orgs Developer Console Setup Objects Object Relationship Object Manager Page Layout Multitenant Architecture Governor Limits Metadata Standard Objects Custom Objects Fields Formula Fields Roll Up Summary Fields Master Detail Relationship LookUp Relationship Validation Rules Web to Lead Chatter Schema Builder Workflow Rules Process Builder Workflow vs Process Builder Salesforce Master Class 2.0 Apex Triggers Visual Flow Apex Visualforce Static Resources SOQL SOSL SOQL vs SOSL Workbench DML Lightening Components/Aura Lightening Web Components Lwc vs Aura Lightening Design System Apex Test Class Approval Process Reports  Dashboards Data Loader, Import wizard Salesforce Data Security Apex CallOuts Integration Public Groups, Sharing Rules Sandbox and Production Change Set Deployment Salesforce Master Class 1.0 Overview - Salesforce Classic Salesforce Classic is the earlier version of the UI which was provided within the Salesforce Application ...

Is React Native Garbage ?

Well we shall look into two different scenarios inorder to understand this fully. Scenario 1. Company like Google or Apple who wants to release an app and wants real crazy fast app load, wants better control over hardware and does not much care about the cost of hiring teams of native developers for different platforms. This is the case when one should opt for Native code bases like Java or Swift.  Now lets look at our next Scenario. Scenario 2. A startup wants to grow crazy fast. It has cost constraint but wants to reach the consumer base of both web, ios and android. In such a scenario, the startup settles down with a framework like React Native and does not bother if the app loads up a little slow, and serves its purpose of getting to the larger audience faster with a bunch of Javascript Developers. So, nothing is garbage. Its just two different scenarios and different priorities based on Business demand.