Option Sets (Choices) in Dataverse store both a numeric value and a display label. This page explains how DvSchemaSync handles these fields for reporting.
How Option Sets Work in Dataverse
Each option set choice has two components:
• Value — A numeric integer (e.g., 1, 2, 100000000)
• Label — The display text shown to users (e.g., "Active", "Pending", "Completed")
What Gets Synchronized
DvSchemaSync creates two columns for each option set field:
| SQL Column | Type | Contains |
|---|---|---|
| statuscode | INT | The numeric value (e.g., 1, 2, 100000000) |
| statuscode_label | NVARCHAR | The display label (e.g., "Active", "Inactive") |
This dual-column approach allows you to use the label for display in reports while still having the numeric value available for filtering and joins.
Example: Account Status
For the Account table with a Status Reason field:
| accountid | name | statuscode | statuscode_label |
|---|---|---|---|
| abc-123... | Contoso Ltd | 1 | Active |
| def-456... | Fabrikam Inc | 2 | Inactive |
Multi-Select Option Sets (Choices)
For multi-select option sets, the values and labels are stored as comma-separated strings:
• fieldname — "1,3,5" (numeric values)
• fieldname_label — "Option A, Option C, Option E" (display labels)
💡 Tip: Use the _label columns in Power BI or Excel reports for user-friendly display. Use the numeric columns when you need to filter or join data programmatically.
Using the Option Set Tables
DvSchemaSync creates dedicated option set tables (optionset, status_optionset) that enable advanced reporting scenarios:
• Dynamic label resolution — Join to resolve values without relying on _label columns
• Option set discovery — Query available options for dropdown filters in reports
• Cross-table analysis — Compare option usage across multiple entities
• Filter list population — Populate dropdown filters in Power BI or Excel from option metadata
Example: Resolve Status Labels Using optionset Table
SELECT a.name, a.statuscode, os.option_label FROM account a LEFT JOIN optionset os ON os.entity_logical_name = 'account' AND os.attribute_logical_name = 'statuscode' AND os.option_value = a.statuscode
💡 Tip: Use the _label sidecar column for simple reports. Use the option set tables when you need to populate filter dropdowns or analyze option set metadata across entities.