Dataverse - How to retrieve FetchXML or SQL for Dataverse views

With Dataverse, we can define views which enable us to carry out basic joins, and to filter and to sort data server-side.

As an example, here's the definition of a view that's based on a custom table called 'Property'. This view retrieves the address, city, and property type conlumns from this table, and inlcudes a filter to return only records where the property type matches 'house'. The name of this view is 'houses'.



Dataverse stores the definition of this view in a standard table called Views. If we open this table in the Dataverse designer, we notice two interesting columns - FetchXML and 'Offine SQL Query'.



By default, it isn't possible to view the contents of this table in the designer - the 'Data' tab is missing from the designer

However, we can access this table through other means, such as through the TDS endpoint, or by building an app that's based on this table.

The screenshot beneath illustrates an auto-generated app that's based on the 'Views' tables, and highlights how we can display the FetchXML and SQL definition of the 'houses' view.


Conclusion

Dataverse stores view definitions in a table called Views. We can access the contents of this table and use it to discover the FetchXML and SQL definitions of the Dataverse views.

Related posts

Dataverse - How to set yes no values with checkbox- Walkthrough
January 29, 2025
Dataverse - Add image column missing when creating table - how to fix
January 19, 2025
Data - How to view the progress and status of a Dataverse CSV/Excel Import
January 15, 2025
Error - Diagnosing the error "Network error when using the Patch function" when saving data with a form
May 05, 2024
Dataverse - How to work around the error "multiple levels of many-to-one relationship expansion aren't supported"
April 05, 2024
Dataverse - The easiest way to modify Dataverse data outside of Dataverse and Power Apps
February 18, 2024
Dataverse - How to use a checkbox control a set a yes/no field in Dataverse
July 10, 2023
Dataverse - How to create Entity Relationship diagrams
January 22, 2023
Dataverse - How you can more quickly bulk update data using the SQL language
January 14, 2023
Dataverse - How to fix the bug in the 'Business Rules' editor that prevents numeric values from saving
January 05, 2023
Dataverse - What are the benefits, and how to create formula columns
July 20, 2022
Dataverse - How to sort the available choice items from a choice column
May 12, 2022
Error - Unable to modify Dataverse tables with error message, Language id should not be null
September 27, 2021
Data - Why is Dataverse so fast?
June 15, 2021
Dataverse - How to create and use Dataverse views in Canvas Apps
June 09, 2021
Dataverse - How to filter Dataverse choice columns
June 07, 2021
Dataverse - How to switch to the classic designer when the option is not available
May 26, 2021
Licensing - What are Dataverse Restricted tables?
March 26, 2021
Media - How to save and work with microphone recordings
March 09, 2021
Dataverse - how to access tables from another environment
February 23, 2021
Dataverse - How to Patch the 5 most complex data types
January 19, 2021