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

PowerApps通过TextInput/TextInput+ComboBox筛选Gallery失败求助

你的代码存在三个核心问题:

  1. 重复编写TextInput1.Text in Item_Description判断,逻辑冗余
  2. ComboBox筛选条件不完整:未指定要匹配的数据源字段,也未处理ComboBox未选中时的场景
  3. 逻辑运算符组合错误,导致ComboBox的筛选规则未生效

以下是两种符合需求的修正方案,按需选择:

方案1:TextInput必选,ComboBox可选(选中时同时满足两个条件)

当ComboBox有选中值时,同时匹配关键词和分类;无选中时仅按关键词筛选:

Filter(
    WD_Stock_Items_SP_List,
    TextInput1.Text in Item_Description && 
    (IsBlank(ComboBox1.Selected.Value) || Item_Category = ComboBox1.Selected.Value)
)

将Item_Category替换为你实际要通过ComboBox筛选的SharePoint列表字段名称

方案2:TextInput和ComboBox均可单独使用(支持任意组合筛选)

支持单独用关键词筛选、单独用分类筛选,或两者结合筛选:

Filter(
    WD_Stock_Items_SP_List,
    (TextInput1.Text in Item_Description || IsBlank(TextInput1.Text)) && 
    (IsBlank(ComboBox1.Selected.Value) || Item_Category = ComboBox1.Selected.Value)
)

同样需替换Item_Category为目标字段;若要忽略大小写差异,可改为Lower(TextInput1.Text) in Lower(Item_Description)

额外注意

确保ComboBox的Items属性绑定了正确的选项源,比如从SharePoint列表的目标字段中提取唯一值:

Distinct(WD_Stock_Items_SP_List, Item_Category)

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.07 03:17:08