<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width,
initial-scale=1, maximum-scale=1, user-scalable=no">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/css/bootstrap.min.css">
<script
src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/js/bootstrap.bundle.min.js">
</script>
</head>
<br/>
<br/>
<div class="d-flex justify-content-center" style="padding:20px;">
<div class="dropdown">
<a class="btn btn-secondary dropdown-toggle" href="#"
role="button" data-bs-toggle="dropdown" aria-expanded="false" >
Data Extension Type
</a>
<ul class="dropdown-menu">
<li>
<a class="dropdown-item" href="?at=true">Sendable</a>
</li>
<li>
<a class="dropdown-item" href="?at=false">Non Sendable</a>
</li>
</ul>
</div>
<br/>
</div>
<table class="table table-bordered table-dark" style="width:100%;padding:50px;">
<thead>
<tr>
<th scope="col">#
</th>
<th scope="col">Name
</th>
<th scope="col">CustomerKey
</th>
<th scope="col">CategoryID
</th>
</tr>
</thead>
<tbody>
%%[set @status=QueryParameter('at')]%%
<script runat="server" language="javascript">
Platform.Load("core", "1");
var prox = new Script.Util.WSProxy();
var status=Variable.GetValue("@status");
var props = {
QueryAllAccounts: true };
var cols = ["Name","CustomerKey","CategoryID","IsSendable"];
var filter = {
Property: "IsSendable",
SimpleOperator: "equals",
Value: status
};
var opts = {
BatchSize: 25
};
var data = prox.retrieve("DataExtension", cols,filter);
for (var i=0;i<data.Results.length; i++)
{
Write('<tr>')
Write('<td>' + i +'</td>');
Write('<td>' + data.Results[i].Name +'</td>');
Write('<td>' + data.Results[i].CustomerKey +'</td>');
Write('<td>' + data.Results[i].CategoryID +'</td>');
Write('</tr>')
}
//Write(Stringify(data.Results));
</script>
</tbody>
</table>
<p class="d-flex justify-content-center">
Thank you for selecting %%=QueryParameter('at')=%%.
</p>
<br/>
<br/>
</html>
Comments
Post a Comment