【问题标题】:Blank() causes an error in an if() - PowerAppsBlank() 在 if() 中导致错误 - PowerApps
【发布时间】:2018-04-21 02:02:45
【问题描述】:

我正在尝试通过选择将更新屏幕上的表格的单选按钮从 Dynamics 365 中过滤表格。

用户有三个选项可供选择:“学校”、“商业”、“全部”。

当用户选择“全部”时,它应该查看“帐户”表并在“行业代码”列中搜索空白值。

下面是一个有效的Filter(),它返回我想要的结果

Filter(Accounts,industrycode = Blank())

但是,如果我向它添加一个 If() 语句来确定用户从收音机中选择的值,我会收到一条错误消息,指出“=”符号是无效的参数类型。

Filter(Accounts,industrycode = If("All" in radio_cust_type.Selected.Value,Blank()))

编辑:当我想检查“学校”时,我使用如下过滤器:

Filter(Accounts,industrycode=If("School" in radio_cust_type.Selected.Value,34)) 

我打算稍后合并这两个过滤器,但现在我想检查空白

【问题讨论】:

  • 如果用户选择“学校”或“企业”,你想显示什么?
  • industrycode 是 Dynamics 365 中的整数,因此当用户选择“School”时,结果将为“34”,过滤器为 'Filter(Accounts,industrycode=If("School" in radio_cust_type.Selected.Value,34))'。但目前 Dynamics 中的“商业”行业代码为空

标签: if-statement filter powerapps


【解决方案1】:

这应该可行:

If(
radio_cust_type.Selected.Value="All", Filter(Accounts, industrycode = Blank()),
radio_cust_type.Selected.Value="School", Filter(Accounts, industrycode = 34),
radio_cust_type.Selected.Value="Business", Filter(Accounts, industrycode = XX)
)

XX 是“企业”的行业代码

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多