Dataverse for Architects: Designing with Alternate Keys in Mind
In Microsoft Dataverse, data integrity and uniqueness are critical for building scalable, enterprise-grade apps. While Dataverse ensures every row has a system-generated GUID as its primary key, real-world business scenarios often require natural identifiers like Customer Numbers or Email Addresses to enforce uniqueness.
This is where Keys in Dataverse—both primary and alternate—become essential. In this guide, we’ll deep dive into:
- What keys are in Dataverse
- Technical details for developers
- Strategic insights for architects
- Real-world use cases
- Limitations and best practices
What Are Keys in Dataverse?
A key in Dataverse defines a column (or set of columns) that enforces uniqueness in a table.
This means no two rows can have the same value for the key column(s).
There are two types of keys in Dataverse:
Primary Key (System-Managed)
- Every Dataverse table automatically includes a GUID primary key (e.g., `contactid`, `accountid`).
- Assigned automatically when a record is created.
- Immutable – once created, it never changes.
Example:
`accountid = 15f2b5d0-34d1-4a18-8e42-44c9b33e43a2`
Alternate Keys (User-Defined)
- Alternate keys let you enforce uniqueness on one or more columns of your choice.
- They’re great for business identifiers like Customer Numbers, Emails, or SKU Codes.
How to Create Alternate Keys
Step-by-Step
1️⃣ Go to [Power Apps Maker Portal](https://make.powerapps.com)
2️⃣ Select your table (e.g., Account) → Keys tab
3️⃣ Click + New Key
4️⃣ Choose column(s) to define as unique
5️⃣ Save and Publish
Supported Column Types:
- Single Line of Text (max 450 chars)
- Whole Number
- Decimal Number
- Lookup (relationships)
Best Practices
- Use alternate keys for external system IDs (e.g., SAP Customer ID).
- Prefer single-column keys for simplicity and performance.
- Avoid using fields that frequently change as keys.
- For composite keys, keep the number of columns minimal.
- Always test large imports or API calls for duplicate key errors.
Real-World Use Cases
- 🛒 E-commerce: `SKU` as alternate key for Product table.
- 🏥 Healthcare: `PatientID` as alternate key for Patient table.
- 📦 Supply Chain: Vendor or Purchase Order Numbers for integration with ERP.
- 📧 CRM: `emailaddress1` for deduplication of Contacts.
Summary
Keys in Dataverse are a must-have tool for both developers and architects:
- Developers – For clean APIs, upserts, and cross-system references
- Architects – For maintaining data integrity and future-proofing solutions
By mastering keys, you can build enterprise-grade, scalable solutions with confidence.
Published on:
Learn moreWe can help you with Dataverse for Architects: Designing with Alternate Keys in Mind
If you want help implementing, troubleshooting, or improving this product, contact us and we’ll point you in the right direction.
Related posts
From Conversations to Automation: Understanding Microsoft Copilot Studio
In November 2023, Microsoft announced that Power Virtual Agents was becoming part of Microsoft Copilot Studio. Microsoft now characterizes Cop...
Copilot Studio: Agent Integration Approaches — Tools, Knowledge, and Agents
In Copilot Studio, agent integration employs the same fundamental integration concepts and patterns used in traditional enterprise integration...
Copilot Studio: How to Plan Integration with Enterprise Systems
Integrating Microsoft Copilot Studio agents with enterprise systems transforms a basic chatbot into a secure, intelligent digital teammate tha...
Book Review : The Manager 's Path : A Guide for Tech Leaders Navigating Growth and Change by Camille Fournier
After a long time, I came across a book that is truly valuable for engineering students and professionals, especially those working in t...
Power Platform Environment Deep Dive (Part 2)
In Microsoft Power Platform, choosing the right environment type is important because each environment is designed for a different business pu...
Power Platform Environment Deep Dive (Part 1)
Today, in the business enterpriese world, Power Platform enables organization to build application, automate workflow, analyze data crea...
Book Review : Life 3.0 by Max Tegmark
This is the third book I’ve read this year, and even though I’m still in the early chapters, it already feels like my favorite read of the yea...
Dataverse Views Demystified: Making Data Work for You
In Microsoft Dataverse, users do not always see all the data stored in a table. What they can view depends on their security permissions, role...
