
Announcements
Hi all,
I have developed a power page site to show a dataverse table using html code.
The Table is showing in development stage image is attached
But while previewing the page the data is not displaying
The HTML code which i have used is here
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Employee Table</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
<entity name="cr0a8_alzoneemptab">
<attribute name="cr0a8_alzoneemptabid" />
<attribute name="cr0a8_empid" />
<attribute name="cr0a8_empname" />
<attribute name="cr0a8_empage" />
<order attribute="cr0a8_empid" descending="false" />
<div class="col-md-12 columnBlockLayout">
{% if data.results.entities.size > 0 %}
{% for results in data.results.entities %}
<tr class="record-row" data-record-id="{{results.cr0a8_alzoneemptabid}}">
<td>{{ results.cr0a8_empid }}</td>
<td>{{ results.cr0a8_empname }}</td>
<td>{{ results.cr0a8_empage }}</td>
<td><button class="delete-button" data-id="{{results.cr0a8_alzoneemptabid}}">Delete</button></td>
const tenantId = '7000c790-ec15-46b5-9b21-c47f8ff50c78';
const clientId = 'be54b18f-a128-4d1f-b6ec-ee2d93375f25';
const clientSecret = 'onS8Q~FhdWIpKTgSWJQUsegNs3Q1EvNNHGrxBaQw';
const resource = 'https://org0c60e65e.crm8.dynamics.com/';
const tokenEndpoint = `https://login.microsoftonline.com/${tenantId}/oauth2/v2.0/token`;
async function getAccessToken() {
const response = await fetch(tokenEndpoint, {
'Content-Type': 'application/x-www-form-urlencoded'
scope: `${resource}/.default`,
grant_type: 'client_credentials'
throw new Error('Failed to obtain access token');
const data = await response.json();
async function deleteRecord(recordId, accessToken) {
const deleteUrl = `${resource}/api/data/v9.1/cr0a8_alzoneemptabs(${recordId})`;
const response = await fetch(deleteUrl, {
'Content-Type': 'application/json; charset=utf-8',
'Authorization': `Bearer ${accessToken}`
const errorText = await response.text();
throw new Error(`Failed to delete record: ${errorText}`);
alert('Record deleted successfully');
document.addEventListener('DOMContentLoaded', function() {
document.querySelectorAll('.delete-button').forEach(button => {
button.addEventListener('click', async function() {
const recordId = this.getAttribute('data-id');
if (confirm('Are you sure you want to delete this record?')) {
const accessToken = await getAccessToken();
await deleteRecord(recordId, accessToken);
@NeethuVenu Hello
Please check the Table Permission. From the screenshot, I can see you're trying to access the table "anonymously". Please check if your table has read access for anonymous users.
Cheers
If this post helps resolve your issue, please mark it as the Accepted Solution