CommonDataService.Database
A Dataverse environment's tables (Dynamics 365, Power Apps) to navigate, read through its Web API.
Group: Online services. Power Query M has it too: a query that uses it is written as in Power BI.
Syntax
CommonDataService.Database(serverUrl as text, optional options as nullable record) as table
| Parameter | Type | Description |
|---|---|---|
serverUrl | text | The environment: norwayanalytics.crm4.dynamics.com, or its https:// address. |
options | nullable record optional | Accepted as Power Query writes it; none is read. |
Returns
table. Name, Data, Schema ("dbo"), Item and Kind ("Table"), a row per table you may read, by logical name.
Remarks
- A table's rows are read 5,000 at a time, every page. A lookup's value comes in a column named after the lookup (parentcustomerid, which the Web API calls _parentcustomerid_value), as Dataverse's SQL endpoint names it.
- Each column gets a type from the values in it: whole numbers Int64.Type, other numbers number, true and false logical, ISO dates and times as dates, datetimes or datetimezones, the rest text; a column whose values are of several kinds is any.
- A table without rows still has its columns, typed from the table's definition.
- Signed in with your Microsoft work account: the studio asks the first time this computer reads the source, and keeps the sign-in on this computer only.
Examples
The accounts table
CommonDataService.Database("norwayanalytics.crm4.dynamics.com"){[Schema = "dbo", Item = "account"]}[Data]
Result: not shown here: it needs a Dataverse environment and a sign-in.