使用 Power Query 在 Common Data Service (CDS) 中新建实体Create new entities in the Common Data Service (CDS) using Power Query

集成 Power Query 后,商业应用程序开发者可以根据各种数据源在 Common Data Service (CDS) 中新建实体。With the integration of Power Query, business app developers can create new entities in the Common Data Service (CDS) from a wide range of data sources.

使用 Common Data Service,用户可以在一组标准实体和自定义实体中安全地存储和管理数据。The Common Data Service lets users securely store and manage data within a set of standard and custom entities. 实体是一组用于存储数据的字段,类似于数据库中的表。An entity is a set of fields used to store data, similar to a table within a database. 将数据存储在 Common Data Service 后,可以使用 Microsoft PowerApps 生成各种应用程序,以使用存储的数据。Once the data is stored in the Common Data Service, you can use Microsoft PowerApps to build rich applications that use the stored data.

集成 Power Query 后,使用 PowerApps 的商业应用程序开发者可以根据外部数据源中的数据,在 Common Data Service 中新建实体,包括本地数据源(如关系数据库(SQL Server、IBM DB2 等)、Excel、Access 和文本文件)、在线服务(Salesforce、Azure SQL 数据库和数据仓库、Web API、OData 数据源)以及其他许多数据源。With Power Query integration, business app developers using PowerApps can create new entities in the Common Data Service based on data from external data sources, such as on-premises data sources like relational databases (SQL Server, IBM DB2, and so on), Excel, Access, and text files, as well as online services such as Salesforce, Azure SQL Database and Data Warehouse, Web APIs, OData feeds, and many more sources. 除了可以连接到各种数据源,使用 Power Query,还可以先筛选、转换和组合数据,然后再将数据加载到 Common Data Service。In addition to the wide array of data sources to which you can connect, using Power Query also lets you filter, transform, and combine data before loading it into the Common Data Service.

根据数据新建实体

启用使用 Power Query 新建 CDS 实体的功能Enabling the CDS New Entities from Power Query feature

此功能在 PowerApps 租户中可用,但默认处于禁用状态。This feature is available in your PowerApps tenant, but is not turned on by default. 可以在 web.powerapps.com 中启用此功能。You can enable it in web.powerapps.com.

注意:只能在已创建的数据库中新建自定义实体。Note: You can create new custom entities only in databases that you have created.

在 PowerApps 门户中,按照下列步骤操作,启用此功能:In the PowerApps portal, take the following steps to enable this feature:

  1. 在左侧导航窗格中,依次转到“Common Data Service”>“实体”选项卡。Browse to the Common Data Service > Entities tab, in the left navigation pane.
  2. 在“实体”列表中,选择“新建实体”下拉菜单。From the Entities list, select the New Entity dropdown.
  3. 在下拉菜单显示的列表中,选择“根据数据新建实体(技术预览版)”,如下图所示。From the list that appears in the dropdown menu, select New Entity from Data (Technical Preview) as shown in the following image.

    根据数据新建实体

  4. 从菜单中选择“根据数据新建实体(技术预览版)”后,便会看到一个对话框,其中列出了技术预览版中的可用连接器,如下图所示。Once you select New Entity from Data (Technical Preview) from the menu, a dialog appears with the list of available connectors in this Technical Preview, as shown in the following image.

    可用连接器

  5. 选择要使用的连接器后,便可以继续执行后续步骤,指定数据源连接详细信息和凭据、选择要导入的表等。Once you've selected the connector you want to use, you can continue to the next steps to specify data source connection details and credentials, select which tables to import, and so on. 还可以访问“查询编辑器”(使用“导航器”视图中的“编辑”按钮),从而在将数据导入 CDS 前执行筛选或数据转换步骤。You may be able to access the Query Editor as well (using the Edit button in the Navigator view) and thereby apply filters or data transformation steps before importing data into CDS.

调整加载设置和其他行为Adjust load settings and other behavior

完成上一部分中的步骤,且数据源可用于 在 CDS 中使用 Power Query 新建实体后,便可以调整其他加载设置,如刷新行为和实体专属设置(如显示名称、主键等)。Once you've completed the steps in the previous section, and have a data source ready to use to create new entities in CDS using Power Query, you can adjust additional load settings, such as refresh behavior and entity-specific settings (such as Display Name, Primary Keys, and others).

完成这些步骤并选择“加载”后,便会在 CDS 中新建自定义实体。Once those steps are completed and you select Load, you will have created new custom entities in CDS. 初始加载后,也可以访问特定实体的“实体”菜单,从而编辑查询。You can also edit queries after the initial load by accessing the Entity menu for a specific entity.

我们非常高兴地宣布推出此功能,很想听到大家的反馈。We're very excited about this functionality, and are eager to hear your feedback. 向我们发送对此功能的建议和反馈Please send us your suggestions and feedback about this feature!