自定义 PowerApps 中的窗体Customize forms in PowerApps

自定义显示窗体控件和编辑窗体控件,使其在可帮助用户轻松了解和更新数据的控件中,以最直观的顺序显示最重要的数据。Customize a Display form control and an Edit form control so that they show the data that matters most, in the most intuitive order, and in the controls that help users easily understand and update the data.

每个窗体包含一个或多个卡,其中每个卡均可显示数据源中特定列的数据。Each form comprises one or more cards, each of which shows data from a particular column in the data source. 按照本主题中的步骤操作,可以指定在窗体中显示的卡、在窗体中上下移动卡及配置每个列中的数据在卡内的显示方式。By following the steps in this topic, you can specify which cards appear in a form, move cards up and down within a form, and configure how data from each column appears within a card.

如果不熟悉 PowerApps,请参阅 PowerApps 简介If you're unfamiliar with PowerApps, see Introduction to PowerApps.

先决条件Prerequisites

你可以查看本教程,了解一些基本概念,也可以严格按照以下步骤完成操作。You can review this tutorial for general concepts only, or you can follow it exactly if you complete these steps.

  1. 创建连接(从 PowerApps 到 SharePoint)。Create a connection from PowerApps to SharePoint.

  2. 创建 自定义布局 所描述的 SharePoint 列表。Create the SharePoint list that Customize a layout describes.

  3. 基于该列表 自动生成应用Generate an app automatically based on that list.

  4. 在左侧导航栏中,单击或点击右上角的图标,切换到缩略图视图。In the left navigation bar, click or tap an icon in the upper-right corner to switch to the thumbnail view.

    切换视图

显示和隐藏卡Show and hide cards

  1. 在左侧导航栏中,单击或点击中间的缩略图,选择“DetailsScreen1”。In the left navigation bar, click or tap the middle thumbnail to select DetailsScreen1.

    选择详细信息屏幕

  2. 单击或点击任意卡以将其选中,然后在右侧窗格中显示窗体自定义选项。Click or tap any card to select it and show the form-customization options in the right-hand pane.

    选择卡

  3. 在右侧窗格中,单击或点击“AccountID”数据卡的复选框可将其隐藏,单击或点击“ID”列的复选框可将其显示出来。In the right-hand pane, click or tap the checkbox for the AccountID card to hide it, and click or tap the checkbox for the ID column to show it.

    显示卡

对卡重新排序Reorder the cards

  • 单击或点击“标题”卡可将其选中,然后向上拖动它的标题栏,直到“ OrderDate卡突出显示为止。Click or tap the Title card to select it, and then drag its title bar up until the OrderDate card is highlighted.

    移动卡

    正在移动的卡会正好显示在释放鼠标按钮时突出显示的卡的上方。The card that you're moving will appear just above the card that's highlighted when you release the mouse button.

    重新排序后的卡

运行应用Run the app

  1. 在左侧导航栏中,单击或点击中间的缩略图以选中“BrowseScreen1”。In the left navigation bar, click or tap the top thumbnail to select BrowseScreen1.

    BrowseScreen1 缩略图

  2. 按 F5(或选择右上角附近的“预览”图标)打开预览模式。Open Preview mode by pressing F5 (or by selecting the Preview icon near the upper-right corner).

    预览图标

  3. 在右上角,单击或点击加号图标,在“EditScreen1中添加一条记录。In the upper-right corner, click or tap the plus icon to add a record in EditScreen1.

    添加记录

  4. 添加任何所需的数据,然后单击或点击右上角的选中标记图标,将新记录保存在 SharePoint 列表中并返回到“BrowseScreen1”。Add whatever data you want, and then click or tap the checkmark icon in the upper-right corner to save your new record in the SharePoint list and return to BrowseScreen1.

    保存记录

  5. 单击或点击刚刚创建的项的箭头,可在 DetailScreen1 中显示有关该项的详细信息。Click or tap the arrow for the item that you just created to show details about that item in DetailScreen1.

    右箭头

  6. 在右上角,单击或点击加号图标,更新 EditScreen1 中的记录。In the upper-right corner, click or tap the edit icon to update the record in EditScreen1.

    编辑记录

  7. 更改一个或多个字段中的信息,然后单击或点击右上角的复选标记,保存对 SharePoint 列表所做的更改并返回到“DetailScreen1”。Change the information in one or more fields, and then click or tap the check mark in the upper-right corner to save your changes in the SharePoint list and return to DetailScreen1.

    保存更改

  8. 单击或点击右上角附近的回收站图标,删除刚刚更新的记录并返回到“BrowseScreen1”。Near the upper-right corner, click or tap the trash-can icon to delete the record that you just updated and to return to BrowseScreen1.

    删除记录

  9. 按 Esc 键(或者单击或点击左上角附近的关闭图标,具体位于 PowerApps 的标题栏 下方 ),关闭预览模式。Close Preview mode by pressing Esc (or by clicking or tapping the close icon near the upper-left corner, under the title bar for PowerApps).

    关闭预览模式

后续步骤Next steps

  • 按 Ctrl-S 保存应用,以便从其他设备运行该应用。Press Ctrl-S to save your app so that you can run it from other devices.
  • 共享应用,便于其他人运行该应用。Share the app so that other people can run it.