1
votes

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:

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.

1

1 Answers

0
votes

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. 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
)