
In many Power Pages requirement a common requirement is to show list of records related to a table that is present in dataverse. To achieve this functionality in power pages we have predefined object called entityview . With the help of this object list of records for a given dataverse table can be shown. As an example account table records can be shown with the following example.
Step 1 : Login to Power Pages site and then go and create a Page by giving a name as shown in the below screenshot

Step 2 : After Step 1, click on Edit code button on the page it will navigate to a new window where online visual studio code will be opened and then in that webpage copy html add the following content inside paragraph tag as shown in the below screenshot
code :
{% entityview logical_name:'account', name:'All Accounts' %}
<p>We have Total {{ entityview.total_records }}
Customers.</p>
<ul>
{% for acc in entityview.records -%}
<li>{{ acc.name }}</li>
{% endfor %}
</ul>
{% endentityview %}
Step 3 : After Step2, save the html page which was mentioned in step 2 .

Step 4 : Provide necessary table permission for account and add a new permission and provide necessary permissions for the account table and then provide roles who can see it like authenticated users and Administrators as shown below screenshot

Step 5 : Now login to the power pages site . As you entered as authenticated user, once we navigate to that screen we can see list of accounts along with the count as shown in below screenshot

In this way one can easily display list of records present in a dataverse table
Note:
- Here in the above code “All Accounts” is the view that is present in Account table .
- use for loop to iterate the results that are present in the entity view
Discover more from Common Man Tips for Power Platform, Dynamics CRM,Azure
Subscribe to get the latest posts sent to your email.
