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

Power Apps中Google Sheet数字列被识别为文本的排序异常问题

Power Apps中Google Sheets数字列识别为文本的排序问题解决

问题描述

在Power Apps中使用Google Sheets作为数据源时,即便Google Sheets里的「Id」列设置为数字类型,Power Apps仍会将其识别为文本,导致排序结果为1,10,11...,而非预期的数值顺序1,2,3...。

解决方法

方法1:修改Power Apps排序公式

通过AddColumns和Value()函数将文本格式的Id转换为数值后再排序,替换原BrowseGallery的公式为:

SortByColumns(
    Search(
        AddColumns([@Transacciones], "Id_Num", Value(Id)),
        TextSearchBox1.Text,
        "Descripción",
        "Cuenta_x0020_Destino",
        "Cuenta_x0020_origen"
    ),
    "Id_Num",
    If(SortDescending1, Descending, Ascending)
)
  • 原理:AddColumns新增一个Id_Num计算列,Value()函数将原本被识别为文本的Id转换为数值类型,基于该数值列排序即可得到正确的数值顺序。

方法2:确保Google Sheets列格式正确

  • 打开对应的Google Sheets文件,选中「Id」整列
  • 在顶部菜单栏选择「格式」→「数字」→「数字」,统一设置列格式为数字类型
  • 回到Power Apps,刷新Google Sheets数据源,重新同步列信息

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.01 04:35:45