MSBA-250 · Lesson 2 of 12 · 25 min

Tables, columns and data types

▶ Video coming soon A video version of this lesson is on the way.

With the whiteboard design agreed, Signe opened the Lumenvale Facilities solution in Power Apps and created the first table while Maribeth Ferreira-Quon watched. Maribeth had built a small canvas app for the registrar's office the year before, on a table someone else had designed, and she wanted to understand the choices behind it. "Every box on this screen is a decision," Signe told her. "Most of them you can change later. A few you can't. Let's go through them."

This lesson covers the building blocks: the kinds of tables Dataverse offers, the properties you set on a table, the data types available for columns, and the column settings that decide how values are stored, shown and searched. AB-410 lists creating and modifying standard tables, configuring table properties and creating and modifying columns as separate skills; together they are the most practical part of the exam's data modeling objective.

Kinds of tables

When you create a table in Power Apps you choose its type. Most business tables are standard tables: regular relational tables stored in Dataverse's database, with full support for relationships, security, business rules, auditing and forms. Activity tables are a special kind of standard table for things people do: each row has a subject, an optional due date, a regarding lookup that can point to many tables, and it appears in the timeline of the row it is about. Task, Email, Appointment and Phone Call are standard activity tables; you can create custom ones, such as Site Visit.

Virtual tables display data that lives in another system, such as an SQL database or SharePoint, through a connector or data provider; the rows are not copied into Dataverse, so reads and writes go to the source. Elastic tables are designed for very large volumes of data with simple access patterns, such as telemetry or event logs, and trade some relational features for scale. For the inspection model every table except one is standard. Signe considered making Inspection an activity table, because an inspection is something an inspector does on a date, and decided against it: activity tables have a fixed set of behaviors and an inspection here is a long-lived business object with its own children, not a single appointment.

Dataverse table types.
TypeStored inTypical useNotes
StandardDataverse databaseBusiness objects such as Building, Room, InspectionFull relationships, security, rules and auditing
ActivityDataverse databaseThings people do: calls, visits, tasksShown in timelines; regarding can point to many tables; always user or team owned
VirtualAn external systemShowing external data in apps without copying itCapabilities depend on the source and provider
ElasticDataverse, designed for scaleHigh-volume event or sensor dataFewer relational features; designed for horizontal scale

Table properties

A table's properties are set in the table designer, under the table's settings and advanced options. Some matter on day one; others can wait. Signe walked Maribeth through them for the Inspection table.

The display name and plural name are what people see: Inspection and Inspections. The description explains the table's purpose and, as lesson 1 noted, is read by Copilot. The schema name is the permanent logical name with the publisher prefix. The primary column is the column that identifies a row to people: it appears in lookups, in the title of forms and as the first column of views. By default it is a single line of text called Name. Signe changed the Inspection table's primary column to an autonumber called Inspection Number, so every inspection gets a readable identifier such as INS-000214 that people can quote on the phone.

Common table properties. Some advanced options can be turned on but never off; check the designer's note before enabling.
PropertyWhat it doesCan it change later?
Type (standard, activity, virtual, elastic)Decides how the table is stored and what it supportsNo
OwnershipUser or team owned, or organization ownedNo
Schema (logical) namePermanent name used by code and the Web APINo
Display and plural names, descriptionWhat people and Copilot seeYes
Primary columnIdentifies rows in lookups, forms and viewsIts display name and format, yes; it is created with the table
Enable attachmentsAdds notes and file attachments to rowsCan be turned on; cannot be turned off once on
Audit changes to its dataRecords changes for this table when auditing is onYes
Track changesLets external systems and Synapse or Fabric links read only what changedYes
Appear in search resultsIncludes the table in Dataverse searchYes
Can be added to a queue, connections, offline useTurns on specific platform featuresSome are one-way
Image column as primary imageShows a picture on forms and cardsYes

Several advanced options are one-way: once turned on they cannot be turned off, because Dataverse creates supporting columns and relationships. Enabling attachments, for example, adds a relationship to the Note table. Signe's habit is to turn on only what a requirement needs and to note in the design record why each option is on.

The primary column

Every standard table has exactly one primary column, and it must be text. People often leave it as Name and then wonder why lookups show unhelpful values. Good primary columns are short, unique enough to tell rows apart, and meaningful to the people who pick rows from lookups. For Building, the primary column is the building's name ("Orchard Science Center"). For Room, Signe made the primary column a room code that includes the building, such as OSC-114, because two buildings both have a room 114 and an inspector choosing a room from a lookup needs to know which one. For Finding, the primary column is filled automatically by a business rule or flow, because nobody wants to type a name for each of 40 findings.

Worked problem

Choosing a primary column for Room

Rooms are numbered within buildings, so "114" exists in four buildings. Inspectors pick rooms from a lookup on their phones. What should Room's primary column hold?

Show solution
  1. The lookup shows the primary column, so it must tell rooms apart at a glance.
  2. The room number alone is not unique across buildings.
  3. A combined code such as OSC-114, building code plus room number, is short and unique.
  4. Keep the plain room number in its own column for sorting and reports, and add an alternate key on building plus room number (lesson 5) to prevent duplicates.

Answer: Use a combined building-and-room code as the primary column, keep the parts in their own columns, and enforce uniqueness with an alternate key.

Column data types

Each column has a data type that decides what it can hold, how it is stored, how it appears on forms and which operations work on it. Choosing the right type is one of the most important modeling decisions, because most types cannot be changed after the column is created; if a type is wrong you usually create a new column and move the data.

Column data types used in the inspection model. Formula and prompt columns are covered in lesson 4, choices in lesson 5.
Data typeHoldsInspection model example
Single line of textUp to 4,000 characters; formats include plain text, email, URL, phone and ticker symbolRoom code, contractor email
Multiple lines of textLong text, optionally rich textFinding note
Whole numberIntegers; formats include duration, time zone and languageFloor number, estimated minutes
Decimal numberExact decimals with fixed precisionFloor area in square meters
Floating point numberApproximate decimals for scientific valuesSensor readings
CurrencyMoney with a currency and exchange rateEstimated repair cost
Date and time, or date onlyDates with a time-zone behaviorScheduled date, completed on
Yes/NoA two-option choiceRequires follow-up
Choice and ChoicesOne value, or several values, from a defined listResult, priority; campus
Lookup and CustomerA reference to a row in another tableRoom, inspector; contractor
File and ImageA file or picture stored in file capacityPhoto of the failed item
AutonumberGenerated text such as INS-000214Inspection Number
FormulaA value calculated with Power FxDays open
PromptAI-generated text from other columnsPlain-language summary of a finding
A decision tree for choosing a column type. Is it a reference to another row? Lookup. Is it one of a fixed list? Choice or Choices. Is it a number? Then is it money, exact or approximate, leading to Currency, Decimal or Float. Is it a date? Date only or date and time. Is it a file or picture? File or Image. Otherwise text, single line or multiple lines.
A quick way to pick a column type. When in doubt, ask what people will do with the value.

Text columns

Single line of text holds up to 4,000 characters and has formats that change how the value appears and behaves: email addresses become clickable mail links, URLs become links, phone numbers can be dialled from a phone. The format does not validate the value strictly, so an email format does not guarantee a working address; business rules or app logic can add checks. Multiple lines of text is for longer content such as notes and can be configured as rich text, which allows bold, lists and pasted images in the note. Set a sensible maximum length: it does not save space, but it stops a paragraph from being pasted into a column meant for a code.

Number columns

Choose the number type by what the number means. Whole number is for counts and integers. Decimal number stores exact values with a fixed number of decimal places, which is right for measurements and quantities where rounding errors would matter. Floating point stores approximate values and suits scientific readings with a wide range. Currency stores money: each currency column comes with a hidden base-currency column so that amounts in different currencies can be compared, and each row has a currency and exchange rate. Lumenvale works in one currency, so the Estimated Repair Cost column simply uses the organization's base currency.

Lumenvale's base currency is the US dollar. If the college ever records a cost in Canadian dollars for equipment ordered from a supplier across the border, Dataverse converts it to US dollars for reports using the exchange rate stored on the row.

Date columns and time-zone behavior

Date columns cause more subtle bugs than any other type. A date and time column has a behavior that decides how time zones apply. User local stores the value in coordinated universal time and shows it in each user's time zone, which is right for moments such as "the inspection started at 9:14". Date only stores a calendar date with no time and no time-zone conversion, which is right for birthdays and due dates. Time zone independent stores a date and time exactly as entered and shows it the same to everyone, which suits values such as a hotel check-in time.

The danger is using user local for a value that is really a calendar date. If an inspection is scheduled for 12 March as a user local date at midnight, a user in a time zone to the west sees 11 March. Lumenvale's campuses share a time zone, but its online staff and external contractors do not, so Signe set Scheduled Date to date only and Completed On to user local. A column's behavior can be changed from user local to date only or time zone independent, but not back, and existing values may need correcting when you change it, so decide carefully.

Date and time behaviors.
BehaviorStored asShown asUse for
User localUTCConverted to each user's time zoneMoments: started at, completed on
Date onlyA date with no timeThe same date for everyoneCalendar dates: scheduled date, due date
Time zone independentDate and time as enteredThe same for everyone, no conversionLocal times that must not shift

Lookups, files, images and autonumbers

A lookup column stores a reference to a row in another table, and creating one creates a many-to-one relationship, which lesson 3 explains in detail. A customer lookup can point to either an account or a contact. File columns store documents and image columns store pictures, both using file capacity; each has a maximum size you set when you create it, and images can be shown on forms and as the row's primary image. Autonumber columns generate text identifiers from a pattern that can combine fixed text, a sequential number with a set number of digits, random characters and the date. Autonumbers are generated by the server, so they are unique even when many people create rows at once.

Autonumber patterns and sample values. SEQNUM gives a sequence with a minimum number of digits; DATETIMEUTC and RANDSTRING add the date and random characters.
Inspection Number   INS-{SEQNUM:6}            INS-000214
Finding Number      FND-{DATETIMEUTC:yyyyMM}-{SEQNUM:5}   FND-202611-00031
Work Order Ref      WO-{RANDSTRING:4}-{SEQNUM:4}        WO-K7QM-0098

Column settings that matter

Beyond the type, a few settings on every column shape the data. Required can be optional, business recommended (a visual cue) or business required, which forms enforce. Business required is enforced in model-driven forms and in canvas apps that respect it, but it is not a database constraint: data arriving through the API or an import can still omit it unless a business rule or plug-in enforces it. Searchable decides whether the column appears in Advanced find and filters. Column security and auditing, which lessons 9 and 10 cover, can be turned on per column.

Two more decisions are permanent. The column's data type generally cannot be changed, with limited exceptions such as changing a text column's format or converting a text column to autonumber. The column's schema name is fixed. Signe's rule: name and type every column in the design record, and have someone else read it before you create it.

Worked problem

Fixing a wrong type

Maribeth's earlier registrar app stored Credits as a single line of text, so "3", "3.0" and "three" all appear, and reports cannot add them up. How should she fix it?

Show solution
  1. A text column cannot be changed into a number column.
  2. Create a new Decimal number column called Credit Value with one decimal place.
  3. Use a flow or a data import to copy cleaned values from the text column into the new column, fixing "three" and similar entries.
  4. Update forms, views and the app to use the new column, then hide the old one and delete it once nothing uses it.

Answer: Create a correctly typed column, migrate and clean the data into it, switch everything over, then retire the old column.

Creating a table in the designer

The steps to create a table are simple, which is why the decisions around them matter. In Power Apps, open your solution, select New, then Table, then Table again, or start from the data workspace or by describing the table to Copilot. Enter the display name, plural name and description, open the advanced options to set the type and ownership and any one-way options you need, set the primary column's name and format, and save. Then add columns from the table's Columns area: New column, a display name, a description, the data type and its settings. Signe created the seven tables of the inspection model in under an hour, because every decision had already been made on paper.

Maribeth asked whether she could have let Copilot create them all from the photograph of the whiteboard. "You could get close," Signe said, "and then you'd spend the hour checking date behaviors and primary columns. Either way somebody has to make the decisions. I'd rather make them first."

Common mistakes

  • MistakeLeaving the primary column as Name with no meaning.

    InsteadMake the primary column short, meaningful and distinctive, or an autonumber.

  • MistakeUsing user local for calendar dates such as due dates.

    InsteadUse date only for dates without a time, so they do not shift between time zones.

  • MistakeStoring numbers or dates as text.

    InsteadUse the proper type so values can be sorted, filtered, totaled and validated.

  • MistakeAssuming business required stops all incomplete data.

    InsteadIt is enforced by forms; imports and the API need rules or plug-ins to enforce it.

  • MistakeTurning on one-way table options just in case.

    InsteadEnable advanced options only when a requirement needs them, because some cannot be turned off.

Summary and key terms

  • Dataverse tables are standard, activity, virtual or elastic; most business tables are standard.
  • Table type, ownership and schema name are permanent; display names and descriptions can change.
  • The primary column identifies rows in lookups and forms and should be meaningful or an autonumber.
  • Choose each column's data type carefully, because most types cannot be changed later.
  • Date columns have a behavior: user local, date only or time zone independent.
  • Business required is enforced by forms, not by the database.
Primary column
The text column that identifies a row to people in lookups, form headers and views.
Activity table
A table for things people do, with a regarding lookup and timeline support.
Virtual table
A table that shows rows stored in an external system without copying them into Dataverse.
Elastic table
A table type designed for very large volumes with simple access patterns.
Date behavior
The setting that decides whether a date column is converted between time zones.
Autonumber
A text column whose values are generated by the server from a pattern.
Business required
A column requirement level that forms enforce before saving.

Practice problems

Work each problem on paper first, then reveal the answer to check.

  1. Which date behavior should a due date use, and why?

    Show answer

    Date only, so the same calendar date appears for every user regardless of time zone.

  2. Name two table properties that cannot be changed after creation.

    Show answer

    Any two of: table type, ownership, schema name; some advanced options are also one-way once on.

  3. Why might an autonumber be a good primary column for Inspection?

    Show answer

    It gives every row a unique, readable identifier automatically, so nobody has to invent a name.

  4. A column holds money in two currencies. Which type should it use?

    Show answer

    Currency, which stores the currency and exchange rate and a base-currency value for comparison.

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz