Connect External Data in Real-Time Without Duplication
Introduction
Imagine needing to view customer orders stored in an ERP system directly within Microsoft Dataverse—without importing gigabytes of data. Or pulling live inventory numbers from a SQL database into your CRM to empower sales teams with real-time insights. This isn’t a futuristic dream; it’s exactly what Virtual Tables (formerly known as Virtual Entities) enable today.
Virtual Tables act as a dynamic bridge between Microsoft Dataverse and external systems, allowing you to interact with external data as if it were natively stored in your CRM. No duplication, no manual syncing, and no storage costs—just seamless, real-time access.
In this guide, we’ll explore how Virtual Tables work, when to use them, and how to implement them step-by-step in your Dataverse environment.
What Are Virtual Tables?
A Virtual Table is a special type of table in Microsoft Dataverse that connects to an external data source—like an ERP system, SQL database, or REST API. Unlike standard tables, Virtual Tables don’t store data locally. Instead, they fetch and display data on-demand from the external system, ensuring you always see the latest information.
Key Benefits of Virtual Tables
- Eliminate Data Redundancy: Access external data without duplicating it in Dataverse.
- Real-Time Insights: View live data from ERP, SQL, or web services instantly.
- Cost Efficiency: Reduce storage costs by avoiding data imports.
- Seamless User Experience: Use Virtual Tables in model-driven apps, Canvas apps, and Power Automate workflows just like native tables.
- Flexible Integration: Support for OData v4 APIs, SQL databases, and custom data providers.
- When Should You Use Virtual Tables?
Virtual Tables shine in scenarios where:
- Data Resides Externally: Your ERP, legacy system, or third-party API holds critical data that needs to be accessed within Dataverse.
- Real-Time Access Is Essential: Stale data isn’t an option (e.g., live inventory, pricing, or order status).
- Large Datasets Are Involved: Importing massive data into Dataverse is impractical or costly.
- Security or Compliance Constraints Exist: Data must remain in its source system due to governance policies.
Example Use Case:
A manufacturing company uses Virtual Tables to connect Dataverse to their on-premises SAP ERP system. Sales teams now view real-time production schedules and inventory levels in CRM, enabling accurate delivery promises without data duplication.
How Do Virtual Tables Work?
Virtual Tables rely on a data provider to communicate with the external system. Here’s the workflow:
- Query: A user or app requests data from the Virtual Table (e.g., “Show all open orders”).
- Fetch: Dataverse sends the query to the external data provider (e.g., an OData API or SQL connector).
- Return: The provider retrieves the data and sends it back to Dataverse.
- Display: The data appears in Dataverse as if it were a native table.
By default, Virtual Tables are read-only. However, you can enable create, update, and delete (CRUD) operations if the external system supports them.
Implementing Virtual Tables: A Step-by-Step Guide
Step 1: Prepare Your External Data Source
OData v4 APIs: Ensure your API endpoint is accessible and returns data in the correct format.
SQL Databases: Whitelist Dataverse IPs or set up secure connectivity (e.g., Azure Private Link).
Custom Providers: Develop a custom connector if your source isn’t OData or SQL.
Pro Tip: Use tools like Postman to validate your API endpoints before connecting them to Dataverse.
Step 2: Register the Data Source in Dataverse
- Navigate to Power Apps > Dataverse > Tables.
- Under Settings (⚙), select Advanced Settings > Virtual Entity Data Sources.
- Click New and choose your provider (e.g., OData v4).
- Enter connection details (URL, authentication) and test the connection.
Step 3: Create and Map the Virtual Table
- In Dataverse, click + New Table and toggle Virtual Table.
- Select your registered data source.
- Define the schema:
- Map the external system’s primary key to Dataverse.
- Add fields (e.g., “Order Number,” “Status”) and match them to the source’s columns.
- Publish the table.
- Step 4: Test and Deploy
- Open the Virtual Table in Dataverse to verify data appears.
- Embed it in a model-driven app or use it in a Power Automate flow.
- Test CRUD operations if enabled.
Common Challenges and Solutions
- No Data Displayed?
- Confirm the data source URL is correct.
- Check for authentication errors (e.g., expired tokens).
- Verify field mappings (e.g., primary key matches).
- Read-Only Limitations
- Most providers default to read-only. Enable writes by configuring the external system to handle POST/PATCH requests.
- Performance Lag
- Optimize API/database queries (e.g., add filters or indexing).
- Use pagination for large datasets.
- Authentication Issues
- Use Azure Active Directory (AAD) for OAuth-secured APIs.
- For SQL, leverage Azure SQL’s firewall rules or managed identities.