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

Power Apps中按‘Created By’分组报错及统计需求咨询

解决Power Apps按SharePoint「Created By」分组统计的报错问题

核心问题原因

SharePoint的「Created By」是Person类型复杂字段,直接用GroupBy函数对该字段分组会因对象无法哈希而报错,必须先提取字段内的唯一标识(如邮箱、ID)转为可分组的基础类型(文本/数值)。

分步解决方案

  1. 预处理Person字段,提取可分组属性
    使用AddColumns将「Created By」的关键属性(如邮箱、显示名)提取为独立字段,再进行分组:

    ClearCollect(
        GroupedCreatorData,
        GroupBy(
            AddColumns(
                你的SharePoint列表名称,
                "CreatorEmail", 'Created By'.Email,
                "CreatorDisplayName", 'Created By'.DisplayName
            ),
            "CreatorEmail", "CreatorDisplayName",
            "UserSubmittedRecords"
        )
    )
    
    • GroupedCreatorData:存储分组结果的集合
    • UserSubmittedRecords:每个用户对应的所有提交记录集合
  2. 统计需求实现

    • 不同用户总数:CountRows(GroupedCreatorData)
    • 单个用户的提交记录数:在展示分组数据的Gallery中,标签的Text属性设为 CountRows(ThisItem.UserSubmittedRecords)

常见报错排查

  • 确认「Created By」已加载到Power Apps数据源:进入数据源设置,检查该字段是否被勾选,未加载会导致字段找不到的报错。
  • 避免直接分组Person对象:必须提取Email/Id/DisplayName这类基础属性,复杂对象无法被GroupBy处理。
  • 权限验证:确保当前用户拥有读取SharePoint列表「Created By」字段的权限,权限不足会导致分组操作失败。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.27 00:24:55