Power Pages: Leveraging Dataverse Views for Custom HTML Lists


Harnessing Dataverse Views for Power Pages

Dataverse Views are incredibly powerful tools that can save you significant time by allowing you to create custom views with the filters and sorting arrangements you need. These low-code views can be seamlessly integrated into Power Apps, Power Automate workflows, and Power Pages, making them a versatile asset in your development toolkit.

Accessing FetchXML from a Dataverse View

Did you know you can directly access the FetchXML for any view you create in Dataverse? This is particularly useful when you need to extend or customize the functionality of your views beyond the standard capabilities.

How to Retrieve FetchXML:

  1. In your Dataverse environment, navigate to the tables
  2. Locate ‘View Table’
  3. Locate the ‘Fetch XML’ column for the view you want to work with.
    • Tip: Use developer tools to inspect the cell with the FetchXml and copy it from in between the tags. Trying to copy the fetchxml directly can be a bit annoying.
  4. Copy the FetchXML code.
  5. Paste into Liquid FetchXML object in Power Page Web Page or Web Template Editor
  6. Add additional fields or filters

Why is FetchXML Important for Power Pages?

FetchXML is essential when you want to leverage a view to look up related records with custom logic or design. While out-of-the-box functionality allows you to do this on a page using form context, there are scenarios where you might want to go beyond the standard interface—perhaps to build a custom grid or list using HTML for a more visually appealing website.

Instead of starting from scratch, you can utilize the existing FetchXML from a Dataverse view, apply additional filters (such as the page record ID on a lookup column), and integrate this into your custom code. This approach enables you to display related records in a way that aligns with your desired page design while retaining the power and flexibility of Dataverse.

By using FetchXML, you can achieve a more robust and tailored user experience on Power Pages without reinventing the wheel.


Copying FetchXml from Views table
FetchXML from Views table being consumed in Power Pages webpage with an additional filter to filter by the GUID in the request parameters.

Leave a Reply

Discover more from Duke DeVan

Subscribe now to keep reading and get access to the full archive.

Continue reading