從 Common Data Service 匯入或匯出資料Import or export data from the Common Data Service

您可以使用下列其中一種方式,將資料移入或移出 Common Data Service:You can move data into or out of the Common Data Service in one of two ways:

  • 如果您想要一次大量匯入或匯出資料,您可以針對多個實體使用 Microsoft Excel。If you want to do a one-time bulk import or export of data, you can use Microsoft Excel for multiple entities.
  • 您可以使用另一種服務,例如 Dynamics 365 或 Salesforce,甚至是 Excel 檔案,持續對該服務進行單一實體的資料匯入或匯出。If you want an ongoing import or export of data for a single entity to another service, such as Dynamics 365 or Salesforce, or even to an Excel file. 若要設定持續匯入或匯出,您可以使用 Microsoft FlowTo set up ongoing import or export, you can use Microsoft Flow.

匯入或匯出資料一次Import or export data once

從 Excel 匯入資料Import data from Excel

  1. powerapps.com 上,展開 [Common Data Service] 區段,然後按一下或點選左側瀏覽窗格中的 [實體]。On powerapps.com, expand the Common Data Service section and click or tap Entities in the left navigation pane.
  2. 在 [新實體] 旁,按一下或點選省略符號,然後按一下或點選 [匯入資料]。Next to New entity, click or tap the ellipsis, and then click or tap Import data.
  3. 選取您要將資料匯入至哪一個實體,然後按一下或點選 [下一步]。Select the entity that you want to import data into, and then click or tap Next.
  4. 按一下或點選 [搜尋]。Click or tap Search. 選取您要從哪一個檔案匯入資料。Select the file that you want to import data from.
  5. 如果 [對應狀態] 不是 [符合] 且沒有綠色核取記號,則您必須指定實體欄位和 Excel 檔案中之資料行間的對應。If the Mapping Status is not Match with a green check mark, then you will need to specify the mapping between the entity fields and the columns in the Excel file. 若要對應資料行︰To map the columns:
    1. 按一下或點選 [顯示對應]。Click or tap Show Mapping.
    2. 在 Excel 檔案中選取每個實體欄位的符合資料行。For each entity field, select the matching column in the Excel file.
    3. 按一下或點選 [儲存變更]。Click or tap Save changes.
  6. 按一下 [匯入]。Click Import.

將資料匯出至 ExcelExport data to Excel

您可以從標準實體或自訂實體執行一次性資料匯出,也可以一次從多個實體匯出資料。You can do a one-time data export from a standard entity or custom entity, and you can export data from more than one entity at a time. 如果您從多個實體匯出資料,則系統會將每個實體匯出到實體自己的 Microsoft Excel 檔案。If you export data from more than one entity, each entity is exported into its own Microsoft Excel file.

  1. powerapps.com 上,按一下或點選左側瀏覽窗格中的 [實體]。On powerapps.com, click or tap Entities in the left navigation pane.
  2. 在 [新實體] 旁,按一下或點選省略符號,然後按一下或點選 [匯出資料]。Next to New entity, click or tap the ellipsis, and then click or tap Export data.
  3. 選取您要從哪些實體匯出資料,然後按一下或點選 [匯出至 Excel]。Select the entities that you want to export data from, and then click or tap Export to Excel.
  4. 出現 [匯出完成] 時,按一下或點選 [下載匯出的資料] 以下載資料。When Export Completed appears, click or tap Download exported data to download the data.

使用 Microsoft Flow 設定持續匯入或匯出Use Microsoft Flow to set up ongoing import or export

您可以設定一次為單一標準實體或自訂實體進行持續匯入或匯出。You can set up ongoing import or export for a single standard entity or custom entity at a time. 以下為部分您可以連線的位置:Some possible places you can connect to include:

  • Dynamics 365Dynamics 365
  • SalesforceSalesforce
  • 儲存在任何雲端檔案提供者中的 Microsoft Excel 檔案Microsoft Excel files stored in any cloud file provider
  • Microsoft SQL 資料庫,無論是在雲端或內部部署A Microsoft SQL database, both in the cloud and on-premises
  • 您定義連線到您自己系統的自訂連接器A custom connector that you define to connect to your own systems

現在,當您使用 Microsoft Flow 匯入或匯出資料時,這並不是完全同步的服務。Today, when you use Microsoft Flow to import or export data, it is not a full synchronization service. 將物件新增至某個服務時,即會將該物件匯入另一個系統。When an object is added to one service, it will be imported into the other system. 不過,這表示如果將物件從某個系統中刪除,並不會將它也從另一個系統中刪除。However, that means if an object is deleted from one system it will not be deleted in the other system.

設定匯入的方式取決於您要匯入的物件是否已有範本。How to set up the import depends on if a template already exists for the object that you want to import. 如果有範本,您可以設定範本將某個系統的資料複製到另一個系統。If a template exists, you can set it up to copy data from one system to another. 如需詳細資訊,請參閱建立使用 Microsoft Common Data Service 的流程For more information, see Create a flow that uses the Microsoft Common Data Service. 但是,如果沒有這類範本,您就必須建立可以使用資料庫的流程。However, if no such template exists, you'll need to create a flow that can use the database. 如需詳細資訊,請參閱如何從頭開始建立流程For more details, refer to How to create a flow from scratch.