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

如何在PowerApps中用Dropdown筛选SharePoint的Person or Group列数据

适配SharePoint人员/组字段(含多选)的PowerApps下拉菜单实现

1. 构建包含「全部」选项的集合

由于SharePoint人员/组字段的Choices()返回的是带DisplayName、Claims、Email等属性的记录(而非普通文本值),不能直接沿用普通字段的集合写法,需要构造匹配的记录结构:

ClearCollect(
    colPersonOptions,
    { DisplayName: "全部", Claims: "all" }, // 自定义「全部」选项,用Claims做区分标识
    Choices([@'你的SharePoint列表名'].'人员或组字段名')
)
  • 正常人员的Claims格式为i:0#.f|membership|xxx@xxx.com,自定义的"all"不会和其重复,可作为「全部」选项的判断依据。

2. 配置下拉菜单属性

  • Items:设置为colPersonOptions
  • DisplayFields:设置为["DisplayName"](让下拉显示用户名,若需显示邮箱则改为["Email"])
  • SearchFields:设置为["DisplayName"](支持按用户名搜索匹配项)

3. 画廊筛选逻辑(适配多选场景)

如果你的SharePoint人员字段允许多选,用以下公式筛选画廊:

Filter(
    '你的SharePoint列表名',
    If(
        Dropdown1.Selected.Claims = "all",
        true, // 选「全部」时显示所有记录
        Dropdown1.Selected in '人员或组字段名' // 选具体人员时,筛选出该人员在字段中的记录
    )
)

如果是单选人员字段,筛选公式可简化为:

Filter(
    '你的SharePoint列表名',
    Dropdown1.Selected.Claims = "all" || '人员或组字段名' = Dropdown1.Selected
)

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.28 20:13:26