使用 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 Database 和資料倉儲、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

一旦您完成前一節的步驟並準備好使用 Power Query 在 CDS 中建立新實體的資料來源後,您可以調整額外的載入設定,像是重新整理行為和實體特定設定 (如 [顯示名稱]、[主要金鑰] 等其他設定)。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!