This file contains hidden or 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"); | |
try { | |
//authenticate to get access token | |
var authEndpoint = "https://mcxxxxxxxxxx.auth.marketingcloudapis.com/"; //provide auth endpoint | |
var payload = { | |
client_id: "xxxxxx", //pass client id | |
client_secret: "xxxxxx", //pass client secret | |
grant_type: "client_credentials", |
This file contains hidden or 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.1.1"); | |
try{ | |
</script> | |
{{your script goes here}} | |
<script runat="server"> | |
}catch(e){ | |
var errorMsg = Stringify(e.message) |
This file contains hidden or 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.1.1"); | |
try{ | |
</script> | |
{{your script goes here}} | |
<script runat="server"> | |
}catch(e){ | |
var errorMsg = Stringify(e.message) |
This file contains hidden or 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.1.1"); | |
try{ | |
</script> | |
{{your script goes here}} | |
<script runat="server"> | |
}catch(e){ | |
Write("Oops, something went wrong!<br>Please contact [email protected] so we can help you finalize your request."); |
This file contains hidden or 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
function getQueries(objectType, cols) { | |
var prox = new Script.Util.WSProxy(), | |
objectType = "QueryDefinition", | |
cols = ["Name", "Description", "ObjectID", "DataExtensionTarget.Name", "DataExtensionTarget.CustomerKey"], | |
moreData = true, | |
reqID = null, | |
numItems = 0; | |
while (moreData) { | |
moreData = false; | |
var data = reqID == null ? prox.retrieve(objectType, cols) : prox.getNextBatch(objectType, reqID); |
This file contains hidden or 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
function getImports(objectType, cols) { | |
var prox = new Script.Util.WSProxy(), | |
objectType = "ImportDefinition", | |
cols = ["DestinationObject.ObjectID", "Description", "Name", "ObjectID"], | |
moreData = true, | |
reqID = null, | |
numItems = 0; | |
while (moreData) { | |
moreData = false; | |
var data = reqID == null ? prox.retrieve(objectType, cols) : prox.getNextBatch(objectType, reqID); |
This file contains hidden or 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"); | |
try { | |
//initiate WSProxy | |
var prox = new Script.Util.WSProxy(); | |
//initiate data extension | |
var targetDE = 'xxxxxxx-xxxxxxx-xxxxxxxxx'; //pass external key of the target DE | |
var logDE = DataExtension.Init(targetDE); | |
function getImports(objectType, cols) { |
This file contains hidden or 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
<!--–– Copyright © 2020 Zuzanna Jarczynska http://sfmarketing.cloud ––--> | |
<script runat="server"> | |
Platform.Load("Core", "1"); | |
var authEndpoint = 'https://mcxxxxxxxxxxxxxx.auth.marketingcloudapis.com/', //provide API endpoint | |
client_id = 'xxxxxxxxxxx', //pass Client ID | |
client_secret = 'xxxxxxxxxx'; //pass Client Secret | |
var targetDE = 'xxxx-xxxx-xxxx-xxxx-xxxxx'; //pass external key of the target DE |
This file contains hidden or 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 @Submit = RequestParameter("Submit") | |
IF @Submit != "Success" THEN | |
]%% | |
<h2>Email:</h2> | |
<form action="%%=RequestParameter('PAGEURL')=%%" method="GET"> | |
<label for="email">Email address:</label> | |
<input type="email" id="email" name="email" required="yes"> | |
<button type="submit" name="Submit" id="Submit" value="Success">Submit</button> | |
</form> |
This file contains hidden or 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 @Submit = RequestParameter("Submit") | |
IF @Submit != "Success" THEN | |
]%% | |
<h2>Email:</h2> | |
<form action="%%=RequestParameter('PAGEURL')=%%" method="GET"> | |
<label for="email">Email address:</label> | |
<input type="email" id="email" name="email" required="yes"> | |
<button type="submit" name="Submit" id="Submit" value="Success">Submit</button> | |
</form> |