在 Excel 中打开实体数据Open entity data in Excel

通过在 Microsoft Excel 中打开实体数据,可以使用 Microsoft PowerApps Excel 外接程序快速轻松地查看和编辑数据。By opening entity data in Microsoft Excel, you can quickly and easily view and edit data by using the Microsoft PowerApps Excel Add-in. PowerApps Excel 外接程序要求安装 Microsoft Excel 2016。The PowerApps Excel Add-in requires Microsoft Excel 2016.

注意:如果 Microsoft Azure Active Directory (Azure AD) 租户配置为使用 Active Directory 联合身份验证服务 (ADFS),则必须确保已应用 2016 年 5 月更新,以便 Excel 外接程序可以正确地登录。Note: If your Microsoft Azure Active Directory (Azure AD) tenant is configured to use Active Directory Federation Services (AD FS), you must make sure that the May 2016 update has been applied, so that the Excel Add-in can correctly sign you in.

在 Excel 中打开实体数据Open entity data in 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. 显示所有实体。All the entities are shown.
  2. 单击你感兴趣的实体右侧的省略号 (...)。Click the ellipsis (...) to the right of the entity that you're interested in.
  3. 单击“在 Excel 中打开”,打开生成的工作簿。Click Open in Excel, and then open the workbook that is generated. 此工作簿具有实体、环境指针和 PowerApps Excel 外接程序指针的绑定信息。This workbook has binding information for the entity, a pointer to your environment, and a pointer to the PowerApps Excel Add-in.
  4. 在 Excel 中,单击“启用编辑”,允许 PowerApps Excel 外接程序运行。In Excel, click Enable editing to enable the PowerApps Excel Add-in to run. Excel 外接程序将在 Excel 窗口右侧的窗格中运行。The Excel Add-in runs in a pane on the right side of the Excel window.
  5. 如果是首次运行 PowerApps Excel 外接程序,请单击“信任此外接程序”,允许 Excel 外接程序运行。If this is the first time that you've run the PowerApps Excel Add-in, click Trust this Add-in to allow the Excel Add-in to run.
  6. 如果系统提示你登录,请单击“登录”, 然后使用 powerapps.com 上所用的同一凭据进行登录。Excel 外接程序将使用以前的登录上下文并在可以登录时自动登录。If you're prompted to sign in, click Sign in, and then sign in by using the same credentials that you used on powerapps.com. The Excel Add-in will use a previous sign-in context and automatically sign you in if it can. 因此,请验证 Excel 外接程序右上角的用户名称。Therefore, verify the user name in the upper right of the Excel Add-in.

Excel 外接程序将自动读取所选实体的数据。The Excel Add-in automatically reads the data for the entity that you selected. 注意,在 Excel 外接程序读取实体数据之前,工作簿中没有任何数据。Note that there will be no data in the workbook until the Excel Add-in reads it in.

在 Excel 中查看和刷新的实体数据View and refresh entity data in Excel

当 Excel 外接程序将实体数据读取到工作簿后,可以通过单击 Excel 外接程序中的“刷新”随时更新数据。After the Excel Add-in reads entity data into the workbook, you can update the data at any time by clicking Refresh in the Excel Add-in.

在 Excel 中编辑实体数据Edit entity data in Excel

可以根据需要更改实体数据,然后通过单击 Excel 外接程序中的“发布”进行发布。You can change entity data as you require and then publish it back by clicking Publish in the Excel Add-in.

若要编辑一条记录,请选择工作表中的某个单元格,然后更改单元格的值。To edit a record, select a cell in the worksheet, and then change the cell value.

若要添加一条新纪录,请执行以下步骤之一:To add a new record, follow one of these steps:

  • 单击工作表中的任意位置,然后单击 Excel 外接程序中的“新建”。Click anywhere in the worksheet, and then click New in the Excel Add-in.
  • 在工作表的最后一行中单击,然后按 Tab 键,直至光标移出该行的最后一列,创建一个新行。Click in the last row of the worksheet, and then press the Tab key until the cursor moves out of the last column of that row, and a new row is created.
  • 立即单击工作表下方的行,并开始在单元格中输入数据。Click in the row immediately below the worksheet, and start to enter data in a cell. 将焦点移出该单元格时,工作表将会展开以包含新行。When you move the focus out of that cell, the worksheet expands to include the new row.

若要删除一条记录,请执行以下步骤之一:To delete a record, follow one of these steps:

  • 右键单击要删除的工作表行旁边的行号,然后单击“删除”。Right-click the row number next to the worksheet row to delete, and then click Delete.
  • 右键单击要删除的工作表行,然后依次单击“删除” > “表行”。Right-click in the worksheet row to delete, and then click Delete > Table Rows.

添加或删除列Add or remove columns

可以使用设计器调节自动添加到工作表的列。You can use the designer to adjust the columns that are automatically added to the worksheet.

  1. 单击“选项”按钮(齿轮符号)启用 Excel 外接程序的数据源设计器,然后选择“启用设计”复选框。Enable the data source designer of the Excel Add-in by clicking the Options button (the gear symbol) and then selecting the Enable design check box.
  2. 单击 Excel 外接程序中的“设计”。Click Design in the Excel Add-in. 所有数据源均列出。All the data sources are listed.
  3. 在数据源旁,单击“编辑”按钮(铅笔符号)。Next to the data source, click the Edit button (the pencil symbol).
  4. 根据需要,调节“所选字段”字段中的列表:Adjust the list in the Selected fields field as you require:
    • 若要将某个字段从“可用字段”字段添加到“所选字段”字段,请单击该字段,然后单击“添加’。To add a field from the Available fields field to the Selected fields field, click the field, and then click Add. 或者,双击该字段。Alternatively, double-click the field.
    • 若要将某个字段从“所选字段”字段中删除,单击该字段,然后单击“删除”。To remove a field from the Selected fields field, click the field, and then click Remove. 或者,双击该字段。Alternatively, double-click the field.
    • 若要更改字段的顺序,在“所选字段”字段中单击该字段,然后单击“向上”或“向下”。To change the order of fields, click the field in the Selected fields field, and then click Up or Down.
  5. 单击“更新”,然后单击“完成”退出设计器,将所做更改应用到数据源。Apply your changes to the data source by clicking Update, and then click Done to exit the designer. 如果添加了字段(列),则单击“刷新”拉取已更新的数据集。If you added a field (column), click Refresh to pull in an updated set of data.

故障排除Troubleshooting

可以通过一些简单的步骤解决一些问题。There are a few issues that can be resolved through some easy steps.

  • 如果 Excel 外接程序加载元数据时收到“已禁止”消息,则登录到 Excel 外接程序的帐户无权使用目标 Common Data Service 数据库。If you receive a "Forbidden" message while the Excel Add-in is loading metadata, the account that is signed in to the Excel Add-in doesn't have permission to use the targeted Common Data Service database. 要解决此问题,请确认 Excel 外接程序右上角显示的用户名正确无误。To resolve this issue, verify that the correct user name appears in the upper right of the Excel Add-in. 如有需要,单击 Excel 外接程序右上角的用户名,注销,然后重新登录。As required, click the user name in the upper right of the Excel Add-in, sign out, and then sign back in.
  • 如果在登录过程中打开一个空白网页,则帐户需要执行 AD FS,但运行外接程序的 Excel 版本暂不足以加载登录对话框。If a blank webpage opens during the sign-in process, the account requires AD FS, but the version of Excel that is running the Add-in isn't recent enough to load the sign-in dialog box. 根据需要,更新正在使用的 Excel 版本。As required, update the version of Excel that you're using. 若要更新 Excel 版本,请使用 Office 部署工具 从延期频道移至当前频道To update the version of Excel, use the Office deployment tool to move from the deferred channel to the current channel.

如果遇到此处未描述的问题,请通过支持页面联系我们。If you encounter an issue that isn't described here, contact us via the support pages.

后续步骤Next steps