首页 > 解决方案 > Powerapps 过滤器公式中的 2 个条件

问题描述

我使用了 MIKAEL SVENSON 博客中的一些代码:https ://www.techmikael.com/2019/01/a-no-nonsense-solution-to-implement.html 。这是示例代码:

ForAll(
    Filter(
            Cities, // SharePoint list with all cities
            Country.Id = CountrySelector.Selected.Id // Pick cities where country matches the selected one
        )
    ,
    {
        Value: Title, // Create a new item with Value/Id, which will save correct
        Id: ID // It's important to have Value as the first field!
    }
)

如何添加另一个条件?

这是我的工作示例:

ForAll(
    Filter(
            'Bâtiments/Zones', 
            Site.Value = SiteSelection.Selected.Value
        )
    ,
    {
        Value: Title, 
        Id: ID 
    }
)

这是我想做的事情:

ForAll(
     Filter(
             'Bâtiments/Zones', 
             Site.Value = SiteSelection.Selected.Value && Title = ZoneSelection.Selected.Value
         )
     ,
     {
         Value: Title, 
         Id: ID 
     } )

我试过 & AND || 没有成功。

谢谢您的帮助

标签: powerapps

解决方案


ForAll(
    Filter(
            'Bâtiments/Zones', 
            And(Site.Value = SiteSelection.Selected.Value,Titre=ZoneSelection.Selected.Value)
        )
    ,
    {
        Value: Local, 
        Id: ID 
    }
)

推荐阅读