You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何获取Power Automate SharePoint列表轮询触发器的最后检查窗口结束时间?

获取Power Automate轮询触发器最后检查时间点的方法

针对你维护的轮询触发型Power Automate云流,想要获取触发器最后一次检查SharePoint列表项的时间点(而非流的最后运行时间),可以通过以下几种方式实现:

1. Microsoft Graph API调用

通过Graph API直接查询流触发器的属性,其中lastPolledDateTime字段就是最后一次轮询的结束时间:

  • 调用端点:GET https://graph.microsoft.com/v1.0/me/flows/{flow-id}/triggers/{trigger-id}
  • PowerShell示例:
$flowId = "你的流GUID"
$triggerId = "触发器GUID"
$accessToken = "你的访问令牌"

$response = Invoke-RestMethod -Uri "https://graph.microsoft.com/v1.0/me/flows/$flowId/triggers/$triggerId" `
                              -Headers @{Authorization = "Bearer $accessToken"} `
                              -Method Get
# 输出最后轮询时间
$response.lastPolledDateTime

注:流ID和触发器ID可从Power Automate门户的流详情页URL中提取,访问令牌可通过Azure AD应用或Graph Explorer获取。

2. PowerShell管理模块

使用官方的Power Apps管理模块查询触发器信息:

# 安装模块(首次使用)
Install-Module -Name Microsoft.PowerApps.Administration.PowerShell -Force -AllowClobber

# 登录Power Apps租户
Add-PowerAppsAccount

# 替换为你的环境ID和流ID
$envId = "环境GUID"
$flowId = "流GUID"

# 获取触发器列表并筛选轮询触发器
$triggers = Get-AdminFlowTrigger -EnvironmentName $envId -FlowName $flowId
$pollingTrigger = $triggers | Where-Object {$.Properties.triggerType -eq "Polling"}

# 输出最后轮询时间
$pollingTrigger.Properties.lastPolledDateTime

3. Dataverse表查询

Power Automate的触发器元数据存储在Dataverse的flowtriggers表中,直接查询该表的lastpolleddatetime字段即可:

  • 可通过Dataverse Web API、Advanced Find或SQL查询工具执行:
SELECT lastpolleddatetime, name 
FROM flowtriggers 
WHERE flowid = '你的流GUID'

4. 浏览器开发者工具查看

在Power Automate门户打开流详情页,按F12打开开发者工具,在「网络」标签中查找包含triggers的API请求(通常是GET请求),查看返回的JSON数据,其中lastPolledDateTime字段即为目标时间点,无需额外工具即可快速获取。

补充说明

流关闭后,触发器的最后轮询时间会固定在关闭前最后一次完成轮询的时间点,重新开启流时,触发器会从该时间点开始检查后续的SharePoint列表项变更,不会遗漏关闭期间产生的符合条件的项。

内容的提问来源于stack exchange,提问作者user802599

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.19 16:04:58