Power Virtual Agents 有種情景為讓我們的使用者可查詢資料。
本文內容主要說明如何使用 Power Virtual Agents 簡易查詢 Excel 內單筆資料。
題目的來源是我作為某企業 Hackathon 的導師時, 被學員詢問故記錄成文章。
概述
在 Power Virtual Agents 的使用中, 我們可能會提供我們的使用者可查詢他們想要知道的資訊。
若資料在 Excel 的表單中時, 我們可以讓 Power Virtual Agents 怎麼做到呢?
以下內容將把 Excel 存放在 SharePoint Online 內, 並簡單使用兩個欄位的資料進行說明。
正文
有一個記錄分數的 Excel 資料表存在 SharePoint Online 的 Document Library 內。

然後在 Power Virtual Agents 內簡單設計一個流程。
開始我們 Trigger 使用查分數作為 Trigger, 然後回覆一個資訊告訴使用者目前在使用的是什麼 Topic。

然後再新增一個 Question, 輸入內容為讓使用者輸入 ID, 驗證的內容為 Multiple choice options, 並且把 Option 進行刪除。
如要好變數, 可將變數名稱修改為 PointID

之後我們新增 Action 來進行執行查詢動作

Power Automate 開始我們新增一個變數, 名為 ID

然後新增 Get a row 的連接器, 並且選擇至上方我們準備好的 Excel。
在 Key Column 輸入我們想要以什麼 Column 為查詢目標, 並且 Key Value 為我們要查詢的值。
以下根據我們準備的資料表與命名的變數, 我們使用工號作為查詢目標, ID 為我們想要查詢的值。

完成後, 我們需要讓流程回傳我們的查詢結果, 故在結尾補上回傳變數名稱與相關值。

最後, 我們在流程中調整我們上方 Question 的變數為我們 Input 至 Power Automate 的 ID 值, 並且在 Action 下新增 Message 來顯示我們的結果即完成。

成果

以上即為我們簡易使用 Power Virtual Agents 來查詢 Excel 內的資料。
當然如有需要, 我們也可製作較複雜的流程與串接資料庫的方式進行查詢。
以上內容為我個人的見解, 並感謝您的閱讀, 謝謝