简体   繁体   English

基于多项选择 SharePoint 过滤 PowerApps 库列出项目并对库中的所述项目进行排序

[英]Filtering a PowerApps gallery based on multi-choice SharePoint list items and sort said items in gallery

hoping someone can point me in the right direction because I can't seem to make this work.希望有人能指出我正确的方向,因为我似乎无法完成这项工作。

I've got a vertical gallery in my Canvas app that's connected to a customer list in SharePoint Online and I've got a text input box that I want to filter all customers that are in specific deployment phases (phase column is multiple choice in the SP list), I can get the filter to work like so:我的 Canvas 应用程序中有一个垂直图库,它连接到 SharePoint Online 中的客户列表,并且我有一个文本输入框,我想过滤处于特定部署阶段的所有客户(阶段列是SP 列表),我可以让过滤器像这样工作:

Filter(
[@'MASTER SLM Customer Listings'],
DeploymentPhase.Value = "Phase 0 - Initiation" ||
 DeploymentPhase.Value = "Phase 1 - Planning" ||
 DeploymentPhase.Value =  "Phase 2 - Build & Test" ||
 DeploymentPhase.Value = "Phase 3 - Tune & Train" ||
 DeploymentPhase.Value = "Phase 4 - Transition to Operational")

However, that doesn't achieve my end goal.但是,这并没有达到我的最终目标。 When I try to do something like this, all sorts of errors are thrown and I can't work out the correct syntax.当我尝试做这样的事情时,会抛出各种错误,我无法找出正确的语法。 Also, I am very new to coding/developing apps of any sort.此外,我对编码/开发任何类型的应用程序都很陌生。

"SortByColumns(
    Filter(
        [@'MASTER SLM Customer Listings'], StartsWith(DeploymentPhase.Value, searchBox.Text)), "Modified",Ascending)"

Ideally, This gallery will be searchable by Customer Name, only show customers in phases 0 - 4, and then sort them starting at Phase 0 and ascending to Phase 4. Any help in making this work would be greatly appreciated.理想情况下,此图库将可按客户名称搜索,仅显示阶段 0 到 4 的客户,然后从阶段 0 开始对它们进行排序,然后上升到阶段 4。任何帮助完成这项工作将不胜感激。

There is likely a better way to achieve this, but as I'm still learning PowerApps, this is the solution that I eventually figured out.可能有更好的方法来实现这一点,但由于我仍在学习 PowerApps,这是我最终想出的解决方案。 Hopefully, this can help someone else.希望这可以帮助其他人。

Sort(
    Filter(
        Search(
            'MASTER SLM Customer Listings',
            searchBox.Text,
            "Title"
        ),
        DeploymentPhase.Value = "Phase 0 - Initiation" || DeploymentPhase.Value = "Phase 1 - Planning" || DeploymentPhase.Value = "Phase 2 - Build & Test" || DeploymentPhase.Value = "Phase 3 - Tune & Train" || DeploymentPhase.Value = "Phase 4 - Transition to Operational"
    ),
    DeploymentPhase.Value,
    Ascending
)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM