将数据导入或导出 Common Data ServiceImport 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.