This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%%[ | |
var @DEColumn1, @lookupValue | |
set @lookupValue = "whee" | |
set @DEColumn1 = Lookup("DataExtensionName", "ReturnColumn", "LookupColumn", @lookupValue) | |
]%% | |
DEColumn1 is %%=v(@DEColumn1)=%% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script runat="server"> | |
Platform.Load('Core','1'); | |
var username = 'Username'; | |
var password = 'PaSsWoRd'; | |
var serviceURL = 'https://webservice.s7.exacttarget.com/Service.asmx'; | |
//DE contains all the subscribers to be deleted. Delete all subscribers where field value of IsDeletedFromAllsubscribers is False | |
var srcDE = DataExtension.Init("Data Extension External key"); | |
var ds = srcDE.Rows.Retrieve({Property:"IsDeletedFromAllsubscribers",SimpleOperator:"equals",Value:"False"}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%%[ | |
set @returnValue = Lookup("Data Extension name", "Field name fetch from the DE", "Field for matching condition", "Value for matching condition") | |
]%% | |
%%=v(@returnValue)=%% | |
<!-- | |
This function will return only the first occurrence of the record in a DE | |
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%%[ | |
SET @query = "Query text" | |
SET @resultSet = LookupRows("Data Extension name","Field name for matching condition", @query) | |
IF RowCount(@resultSet) > 0 THEN | |
SET @row = row(@resultSet,1) | |
SET @Field1 = Field(@row,"FieldName1") | |
SET @Field2 = Field(@row,"FieldName2") | |
SET @Field3 = Field(@row,"FieldName3") | |
ENDIF | |
]%% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Get all Active | |
SELECT sb.SubscriberKey, sb.EmailAddress, sb.Status, ea.[First Name], ea.[Last Name], ea.Gender, ea.[Date of Birth], ea.Address, ea.Suburb, ea.State, ea.Postcode, sb.DateJoined | |
FROM _Subscribers sb | |
LEFT JOIN _EnterpriseAttribute ea ON sb.SubscriberID=ea._SubscriberID | |
WHERE sb.Status = 'Active' | |
-- Get all Unsubscribe | |
SELECT sb.SubscriberKey, sb.EmailAddress, sb.Status, ea.[First Name], ea.[Last Name], ea.Gender, ea.[Date of Birth], ea.Address, ea.Suburb, ea.State, ea.Postcode, sb.DateJoined | |
FROM _Subscribers sb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script runat="server"> | |
Platform.Load("core", "1"); | |
var url = 'https://auth.exacttargetapis.com/v1/requestToken'; | |
var contentType = 'application/json'; | |
var payload = Stringify({ | |
"clientId": "XXXXXXXXXXXXXXXXXXXXXXXXXX", | |
"clientSecret": "XXXXXXXXXXXXXXXXXXXXXXXXXX" | |
}); | |
var headerNames = ["Encoding"]; | |
var headerValues = ["utf-8"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script runat=server> | |
Platform.Load("Core","1"); | |
</script> | |
<script runat=server> | |
try{ | |
</script> | |
%%[ | |
SET @SKey = RequestParameter("skey") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%%[ | |
VAR @SubscriberKey, @firstName, @lastName, @returnValue | |
SET @SubscriberKey = "123" | |
SET @firstName = "Karma" | |
SET @lastName = "Dorjee" | |
SET @returnValue = UpsertData("My_Test_DataExtension",1,"SubscriberKey",@SubscriberKey,"FirstName",@firstName,"LastName",@lastName) | |
]%% | |
No of affected rows : %%=v(@returnValue)=%% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select | |
x.emailaddress | |
, x.subscriberkey | |
from ( | |
select | |
w.emailaddress | |
, w.subscriberkey | |
, w.insertDate | |
, row_number() over (partition by w.subscriberkey order by w.insertDate asc) ranking | |
from Welcome_Trigger w |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT * FROM "Name_of_the_Data_Extension" WHERE 1 = 2 | |
/* | |
Specify the DE name within a double quote. | |
*/ |