Created
February 13, 2019 15:04
-
-
Save MyCueCards/9c673a302dfdc45205327ec0a43f8854 to your computer and use it in GitHub Desktop.
In a Salesforce Marketing Cloud CloudPage, paste the below in an HTML block. Alter values either line 6 or line 8 to find a particular data extension. If you use 'var deName' in line 6, then you must use 'Property:"Name"' in line 7 (commenting out line 8-9). If you use 'var key' in line 8, then you must use 'Property: "CustomerKey"' in line 9 (c…
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
// Was found posted by Sasa Adzip in December 2018. Source = https://success.salesforce.com/ideaView?id=08730000000cIvUAAU | |
<script runat=server> | |
Platform.Load("core","1.1.5"); | |
var deName="INSERT_DataExtensionName"; | |
var FolderScript= DataExtension.Retrieve({Property:"Name",SimpleOperator:"equals",Value:deName}); | |
//var key="INSERT_ExternalKeyOfDataExtension"; | |
//var FolderScript= DataExtension.Retrieve({Property:"CustomerKey",SimpleOperator:"equals",Value:key}); | |
var FolderID = FolderScript[0].CategoryID; | |
var results = Folder.Retrieve({Property:"ID",SimpleOperator:"equals",Value:FolderID}); | |
var folderName = results [0].Name; | |
var parentFolder=results [0].ParentFolder.Name; | |
var countdown = function(id) { | |
if (id> 0) { | |
var results = Folder.Retrieve({Property:"ID",SimpleOperator:"equals",Value:id}); | |
Write(results [0].Name+">"); | |
return countdown(results[0].ParentFolder.ID); | |
} else { | |
return id; | |
} | |
}; | |
countdown(FolderID); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment