cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Resolver II
Resolver II

Filtering a datatable with an If > placing results in a label > use label as string for flow

  • Hi all, 

    I'm trying to change one of my flows so it sends emails to people dependent on what is selected in the app, it currently sends to the same users regardless.

    I've created an initialize variable which i'm hoping i can pull a label from my app in to set them email send to.

    The datatable in the app displaying possible users is connected to a SP list.

    I want to filter the table so that if the selected item type is 3, then show all with a 2 permission in group 3 column.

    Some images attached to try and make this make sense.

    The If statement label is just showing that it is indeed returning the correct group for this item.

    The filter isn't returning correctly though

    Filter(
    PurchaseOrdersUsers,
    If(
    Gallery1.Selected.Supplier_Type = "1",
    "Group1",
    Gallery1.Selected.Supplier_Type = "2",
    "Group2",
    Gallery1.Selected.Supplier_Type = "3",
    "Group3",
    Gallery1.Selected.Supplier_Type = "4",
    "Group4",
    Gallery1.Selected.Supplier_Type = "5",
    "Group5",
    Gallery1.Selected.Supplier_Type = "6",
    "Group6"
    ) = "2"
    )

    Hopefully this makes sense and you can advise, thank you.




1 ACCEPTED SOLUTION

Accepted Solutions
Super User III
Super User III

@PPSA
Like this...

Filter(
    PurchaseOrdersUsers,
    (Gallery1.Selected.Supplier_Type = "1" And Group1 = "2")
    Or (Gallery1.Selected.Supplier_Type = "2" And Group2 = "2")
    Or (Gallery1.Selected.Supplier_Type = "3" And Group3 = "2")
    Or (Gallery1.Selected.Supplier_Type = "4" And Group4 = "2")
    Or (Gallery1.Selected.Supplier_Type = "5" And Group5 = "2")
    Or (Gallery1.Selected.Supplier_Type = "6" And Group6 = "2")
)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

3 REPLIES 3
Resolver II
Resolver II

I have tried modifying to the below and now get the attached error

Filter(
PurchaseOrdersUsers,
If(
Gallery1.Selected.Supplier_Type = "1",
"Group1",
Gallery1.Selected.Supplier_Type = "2",
"Group2",
Gallery1.Selected.Supplier_Type = "3",
"Group3",
Gallery1.Selected.Supplier_Type = "4",
"Group4",
Gallery1.Selected.Supplier_Type = "5",
"Group5",
Gallery1.Selected.Supplier_Type = "6",
"Group6"="3"))

2020-06-09 12_45_29-Purchase Order App - Saved (Unpublished) - Power Apps.png

Super User III
Super User III

@PPSA
Like this...

Filter(
    PurchaseOrdersUsers,
    (Gallery1.Selected.Supplier_Type = "1" And Group1 = "2")
    Or (Gallery1.Selected.Supplier_Type = "2" And Group2 = "2")
    Or (Gallery1.Selected.Supplier_Type = "3" And Group3 = "2")
    Or (Gallery1.Selected.Supplier_Type = "4" And Group4 = "2")
    Or (Gallery1.Selected.Supplier_Type = "5" And Group5 = "2")
    Or (Gallery1.Selected.Supplier_Type = "6" And Group6 = "2")
)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

Thank you @mdevaney , that works.

Now to pull the visible entries out into a label

Helpful resources

Announcements
secondImage

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

Top Solution Authors
Top Kudoed Authors
Users online (94,248)