I am trying to implement department pages with the Paint layout applied to them. The main setup is for our new Intranet website, but I created a test example for you to easily access since our Intranet is behind an access control list.
I am trying to make a REST call to pull the list of team members working under particular supervisors.
Paint Layout has been applied to the Information Services (Standard) page.
Asset Listing has been nested in Paint Layout Body copy
Rest Resource asset has been AL body copy
Issue:
The system is not passing the metadata value from (Link assets) to the nested REST asset to make a GET call. I have added a link above to a working example for you.
The following Teams folder where asset listing is looking for Link type assets and grabbing metadata value for Rest assets.
JS
var teamId = ‘%globals_get_Team_id%’;
// Function to generate HTML
let response = JSON.parse(_REST.response.body);
let filtered = [];
function generateHTML(data) {
let html = `<div class="team">`;
html += `<div class="team__name">${data.extension_00c20747ec0f41619d1d6d26ceb348ef_hCCCUSTTeam}</div>`;
html += `<div class="team__supervisor">`;
html += `<h4 class="team__supervisor-name">${data.displayName}</h4>`;
html += `<span class="team__position">${data.jobTitle}</span>`;
html += `</div>`;
html += `<div class="team__report-to">`;
data.directReports.forEach(member => {
html += `<div class="team__member">`;
html += `<span class="team__member-name">${member.displayName}</span>`;
html += `<span class="team__member-position">${member.jobTitle}</span>`;
html += `</div>`;
});
html += `</div></div>`;
return html;
}
// Generate HTML and store in a variable
const teamHTML = generateHTML(response);
print(teamHTML);