Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Script for finding a Data Extension and it's folder path using SSJS. Read more here:
<script runat="server">
var DEprop = //use either "Name" or "Customer Key"
var DEval = //provide either the Name or External Key
var FindDE = DataExtension.Retrieve({Property:DEprop,SimpleOperator:"equals",Value:DEval});
var FolderID = FindDE[0].CategoryID;
var DEname = FindDE[0].Name;
var list = [];
var path = function(id) {
if (id> 0) {
var results = Folder.Retrieve({Property:"ID",SimpleOperator:"equals",Value:id});
list.unshift(results [0].Name);
return path(results[0].ParentFolder.ID);
} else {
return id;
Write(list.join("> "));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment