Get the Fields Available for Retrieval with “Describe”

Charlie Fay
1 min readJun 9, 2021

By getting the fields available for retrieval, you can identify what kind of information is returned on a Retrieve call.

Use the Describe method to get information about the metadata associated with an object.

The Describe method supports a request for object metadata in the form of an ObjectDefinitionRequest and returns a single ObjectDefinition object.

Particularly useful when combined with WSProxy retrieve request whereby you must specify the fields to return.

<table border="1" cellspacing="0" cellpadding="1" bordercolor="#000000" style="color:#000000;font-family:Arial;">
<tr>
<th>Name</th>
<th>isRetrievable</th>
</tr>
<script runat="server">
Platform.Load("Core","1.1.1");
try{
var prox = new Script.Util.WSProxy();
var data = prox.describe("DataExtension")
var resultProperties = data.Results[0].Properties;

for ( i in resultProperties ) {
var colName = resultProperties[i].Name;
var Retrievable = resultProperties[i].IsRetrievable;

var color = (Retrievable == true) ? "#228C22" : "#8B0000";
Write("<tr>");
Write("<td>" + resultProperties[i].Name + "</td>");
Write('<td style="color:' + color + '">' + resultProperties[i].IsRetrievable + '</td>');
Write("</tr>");
}
}catch(err){
Write(Stringify(err));
}
</script>
</table>

The output on your page will be like:

--

--

Charlie Fay

I write about Salesforce Marketing Cloud, Marketing Automation, Development and Programmatic Languages. I enjoy solving complex problems with simplicity.