web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Apps
Answered

Filter Condition

(0) ShareShare
ReportReport
Posted on by 204

Hi All,

 

I m in the middle of building an app and want to filter a collection as follows.

 

1. selectedRequestor,Permission.Value = "Add"

AND

2. Status.Value Rjected OR Cancelled

AND

3. WFType.Value= XYZ

I have used the following condition but ii won't filter out Cancelled records from the selectedRequestor collection. Can someone please help me with this?  The selectedRequestor collection ends up with records the Status. Value = Cancelled. 

 

ClearCollect(selectedRequestor1,Filter(selectedRequestor,Permission.Value = "Add" && ( Status.Value <>"Rejected" || Status.Value <>"Cancelled")&& WFType.Value ="XYZ"))

 

Thank you. 

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    155,257 Most Valuable Professional on at

    Hi @NewNW ,

    Just a logic adjustment - you need And &&, not Or || when you use Does not equals <>

    ClearCollect(
     selectedRequestor1,
     Filter(
     selectedRequestor,
     Permission.Value = "Add" && 
     Status.Value <> "Rejected" &&
     Status.Value <> "Cancelled" && 
     WFType.Value ="XYZ"
     )
    )

    although I am also wondering why you have .Value on Text filters.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

     

  • NewNW Profile Picture
    204 on at

    Thank you very much @WarrenBelz really appreciated it. 

  • WarrenBelz Profile Picture
    155,257 Most Valuable Professional on at

    Hi @NewNW ,

    So this is now solved ?

  • mobilismexico Profile Picture
    261 on at

    Can any of you please tell me what is wrong with this comparison?

    Filter(bd_Solicitud_QR, Clave = "PH1B-5-221110")

    Clave is a text field in the data source bd_Solicitud_QR. This cannot be simpler and yet I get an incompatibility error: "Incompatible types for comparison"

     

    mobilismexico_0-1667444713711.png

     

  • WarrenBelz Profile Picture
    155,257 Most Valuable Professional on at

    @NewNW ,

    You have it as the Item of a Form which needs a Record, not a Table. Use LookUp instead of Filter.

  • mobilismexico Profile Picture
    261 on at

    Thank you. The error went away with the formula:

    LookUp(bd_Solicitud_QR, scandata.Text in "Clave" )

     

    However, the Form displays no record when I enter a valid Clave value in my input field.

    mobilismexico_4-1667477950467.png

     

    Is it because I'm not using the result part of the Lookup function? Sorry, but this documentation is not helpful at all:

    https://learn.microsoft.com/en-us/power-platform/power-fx/reference/function-filter-lookup

     

    When the input field is empty the Form displays the first record:

    mobilismexico_5-1667478055001.png

     

  • Verified answer
    WarrenBelz Profile Picture
    155,257 Most Valuable Professional on at

    @mobilismexico ,

    You do not need quotes around the field name

    LookUp(
     bd_Solicitud_QR, 
     scandata.Text in Clave
    )
  • mobilismexico Profile Picture
    261 on at

    thank you, @WarrenBelz 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,070

#2
Valantis Profile Picture

Valantis 639

#3
11manish Profile Picture

11manish 608

Last 30 days Overall leaderboard