從 Excel 資料產生應用程式Generate an app from Excel data

自動根據您上傳到雲端儲存體帳戶 (例如 OneDrive) 的 Excel 檔案中的資料,來建立應用程式。Create an app automatically based on data in an Excel file that you upload to a cloud-storage account, such as OneDrive. 產生應用程式之後,根據您的需求加以自訂並執行,以確保能如您所預期般的運作。After you generate the app, customize it to better suit your needs, and then run it to make sure that it works as you expect.

根據預設,產生的應用程式含有三個畫面:Generated apps have three screens by default:

  • BrowseScreen1 會顯示一或多個欄位的子集、搜尋列和排序按鈕,讓使用者可輕鬆地找到特定的記錄。BrowseScreen1 shows a subset of one or more fields, a search bar, and a sort button that lets users easily find a specific record.
  • DetailsScreen1 會顯示特定記錄的更多或所有欄位。DetailsScreen1 shows more or all fields for a specific record.
  • EditScreen1 會提供 UI 元素,讓使用者可用來建立或更新記錄並儲存其變更。EditScreen1 provides UI elements that let users create or update a record and save the changes.

注意︰您可以根據自訂 SharePoint 清單來產生應用程式。Note: You can also generate an app based on a custom SharePoint list.

必要條件Prerequisites

建立應用程式Create an app

  1. 在 PowerApps Studio 中,按一下或點選 [檔案] 功能表 (靠近左側) 中的 [新增]。In PowerApps Studio, click or tap New on the File menu (near the left edge).

    檔案功能表上的新增選項

  2. 遵循下列任一步驟︰Follow any of these steps:

    • 如果雲端儲存體帳戶出現在 [從您的資料開始] 底下,請按一下或點選 [手機配置]。If your cloud-storage account appears under Start with your data, click or tap Phone layout.

      從資料建立應用程式的選項

    • 如果雲端儲存體帳戶未出現在 [從您的資料開始] 底下,請按一下圖格資料列結尾的箭號。If your cloud-storage account doesn't appear under Start with your data, click the arrow at the end of the row of tiles. 如果您的帳戶出現在連線清單中,請按一下或點選該項目。If your account appears in the list of connections, click or tap that entry.
    • 如果您的雲端儲存體帳戶未出現在 [從您的資料開始] 底下或連接清單中,請按一下或點選 [新增連接],然後按一下或點選您的帳戶項目。If your cloud-storage storage account doesn't appear under Start with your data or in the list of connections, click or tap New connection, and then click or tap the entry for your account. 按一下或點選 [連接],並依照提示來設定連線。Click or tap Connect, and follow the prompts to configure the connection.

      連線至 OneDrive

  3. 在 [選擇 Excel 檔案] 下方,瀏覽至 FlooringEstimates.xlsx,然後按一下或點選該檔案。Under Choose an Excel file, browse to FlooringEstimates.xlsx, and then click or tap it.

    FlooringEstimates Excel 檔案

  4. 在 [選擇資料表] 下方,按一下或點選 [FlooringEstimates]。Under Choose a table, click or tap FlooringEstimates.

    選取 FlooringEstimates 資料表

  5. 按一下或點選 [連接] 以產生應用程式。Click or tap Connect to generate the app.
  6. 如果系統提示您觀看簡介導覽,請按一下或點選 [下一步] 以熟悉 PowerApps 使用者介面的主要區域 (也可以按一下或點選 [略過])。If you're prompted to take an introductory tour, click or tap Next to get familiar with key areas of the PowerApps user interface (or click or tap Skip).

    選擇 [下一步] 以觀看導覽

    注意︰您日後可以隨時按一下或點選右上角附近的問號圖示,然後按一下或點選 Take the intro tour (簡介導覽),即可觀看導覽。Note: You can always take the tour later by clicking or tapping the question-mark icon near the upper-right corner and then clicking or tapping Take the intro tour.

應用程式在建立時,會有根據您資料的預設版面配置,但您也可以自訂資源庫版面配置以符合您的需求。When an app is created, it has a default layout based on your data, but you can customize the gallery layout to fit your needs.

  1. 在左側的導覽列中按一下或點選右上角的圖示,切換至縮圖檢視。In the left navigation bar, click or tap an icon in the upper-right corner to switch to the thumbnail view.

    切換檢視

  2. 按一下或點選頂端縮圖,以確定已選取瀏覽畫面 (BrowseScreen1)。Click or tap the top thumbnail to ensure that the browse screen (BrowseScreen1) is selected.
  3. 按一下或點選資源庫中的任何位置,例如第一個影像。Click or tap anywhere in the gallery, such as the first image.

    選取影像

  4. 在右側窗格中,開啟 [版面配置] 清單,然後按一下或點選包含影像、標題和副標題的版面配置。In the right-hand pane, open the Layout list, and then click or tap the layout that contains an image, a title, and a subtitle.

    選取版面配置

    應用程式的版面配置會變更,以反映您的選擇。The layout of the app changes to reflect your choice.

    採用新版面配置的 BrowseScreen1

變更所顯示的資料Change the data that appears

  1. 在 [搜尋項目] 底下,按一下或點選 [地毯] 以選取標籤控制項。Under Search items, click or tap Carpet to select the Label control.

    在右窗格中,會反白顯示相關聯的清單。The associated list is highlighted in the right-hand pane.

    選取第一個標籤

  2. 在右側窗格中,開啟醒目提示的清單,然後按一下或點選 [名稱]。In the right-hand pane, open the highlighted list, and then click or tap Name.

    設定第一個標籤

  3. 開啟底部的清單,然後按一下或點選 [類別]。Open the bottom list, and then click or tap Category.

    設定類別

    BrowseScreen1 會隨著變更,以顯示每一筆記錄的名稱和類別。BrowseScreen1 changes to show a name and a category for each record.

    具有新內容的 BrowseScreen1

    注意︰根據預設,您可以使用滑鼠滾輪或在觸控式螢幕向上和向下撥動來捲動清單 (稱為資源庫)。Note: By default, you can scroll through the list (called a gallery) by using a mouse wheel or by swiping up and down on a touch screen. 若要使用軌跡板 (或沒有滾輪的滑鼠),請選取資源庫,按一下或點選屬性清單中的 [ShowScrollbar],然後在公式列中將 false 取代為 trueTo use either a trackpad or a mouse without a wheel, select the gallery, click or tap Show Scrollbar in the property list, and then replace false with true in the formula bar.

變更表單中欄位的順序Change the order of fields in a form

  1. 在左側導覽列中,按一下或點選中間的縮圖,以開啟詳細資料畫面 (DetailsScreen1)。In the left navigation bar, click or tap the middle thumbnail to open the details screen (DetailsScreen1).

    DetailScreen 1 縮圖

  2. 按一下或點選影像,以顯示可用於自訂表單的選項。Click or tap the image to show options that are available to customize the form.

    選取卡片

  3. 在右側窗格中,將 [Name (名稱)] 欄位拖曳到清單頂端。In the right-hand pane, drag the Name field to the top of the list.

    移動卡片

    螢幕會隨著更新以反映您所做的變更。The screen updates to reflect the changes you made.

    畫面頂端的名稱

變更控制項Change a control

  1. 在左側的導覽列中,按一下或點選底部的縮圖以開啟編輯畫面 (EditScreen1)。In the left navigation bar, click or tap the bottom thumbnail to open the edit screen (EditScreen1).

    EditScreen1 縮圖

  2. 按一下或點選 [概觀]。Click or tap Overview.

    在此步驟中我們會選取概觀卡片。This step selects the Overview card. 每張卡片都包含了描述卡片用途的文字。Each card contains text that describes the purpose of the card. 您也可以自訂卡片上的控制項。You can also customize the controls on a card. 如需詳細資訊,請參閱〈PowerApps 中的卡片控制項〉。For more information, see Card control in PowerApps.

    選取概觀卡片

  3. 在右側窗格中,按一下或點選卡片的向下箭號,向下捲動,然後按一下或點選 [編輯多行文字]。In the right-hand pane, click or tap the down arrow for the card, scroll down, and then click or tap Edit multi-line text.

    此步驟會顯示控制項中,大到足以顯示文字的各項產品概觀。This step shows an overview of each product in a control that's large enough to display the text.

    變更卡片

執行應用程式Run the app

自訂應用程式後,您可以在 [預覽] 模式中執行應用程式以測試變更。As you customize an app, you can test your changes by running the app in Preview mode.

  1. 在左側導覽列中,按一下或點選頂端的縮圖影像以開啟瀏覽畫面 (BrowseScreen1)。In the left navigation bar, click or tap the top thumbnail to open the browse screen (BrowseScreen1).
  2. 按下 F5 (也可以按一下或點選靠近右上角的 [播放] 按鈕) 以開啟 [預覽] 模式。Open Preview mode by pressing F5 or by clicking or tapping the Play button near the upper-right corner.

    預覽圖示

  3. BrowseScreen1 上,按一下或點選記錄右側的箭號,在詳細資料畫面中顯示記錄 (DetailsScreen1)。On BrowseScreen1, click or tap the arrow to the right of a record to show the record in the details screen (DetailsScreen1).

    選取 [BrowseScreen1] 上的箭號

  4. DetailsScreen1 上,按一下或點選右上角的鉛筆圖示,在編輯畫面中顯示記錄 (EditScreen1)。On DetailsScreen1, click or tap the pencil icon in the upper-right corner to show the record in the edit screen (EditScreen1).

    編輯記錄

  5. 在 [EditScreen1] 中,變更一或多個欄位的資訊,然後按一下或點選右上角的核取記號以儲存變更。On EditScreen1, 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.

    儲存 EditScreen1 上的變更

  6. 按下 Esc (或按一下或點選標題列下方的關閉圖示) 以關閉預覽模式。Close Preview mode by pressing Esc (or by clicking or tapping the close icon below the title bar).

    關閉預覽模式

已知限制Known limitations

如需如何在您的組織內共用 Excel 資料的詳細資訊,請檢閱這些限制For information about how to share Excel data within your organization, review these limitations.

後續步驟Next steps

  • 若要儲存應用程式以便從其他裝置執行,請按下 Ctrl-S。To save the app so that you can run it from other devices, press Ctrl-S.
  • 既然您已了解如何從資料產生應用程式,您可以從頭開始建立應用程式Now that you've learned how to generate an app from data, you can create an app from scratch.
  • 共用應用程式,讓其他人也能夠執行。Share the app so that other people can run it.