Skip to main content
Community site session details

Community site session details

Session Id : TGCvRox2JTAJDERXbGk8aM
Power Apps - Building Power Apps
Answered

Lookup will not work with multiple conditions.

Like (0) ShareShare
ReportReport
Posted on 6 Mar 2022 07:22:45 by 496

Hi ,

 

I'm having below lookup statement on Onchange , It worked perfectly with one condition but with  two conditions , it doesn't do  the validation .  There are no syntax errors . Pls help me 

 

 

If(IsBlank(LookUp(AssetTransactions, AssetNumber=Self.Text && Completed.Value="Complete")),UpdateContext({RecValid: false}),UpdateContext({RecValid: true}),UpdateContext({MakeItRed:!MakeItRed}))

 

With only one condition it's working fine

 

If(IsBlank(LookUp(AssetTransactions, AssetNumber=Self.Text )),UpdateContext({RecValid: false}),UpdateContext({RecValid: true}),UpdateContext({MakeItRed:!MakeItRed}))

 

rgds

AD

Categories:
  • ajithd6368 Profile Picture
    496 on 06 Mar 2022 at 09:35:58
    Re: Lookup will not work with multiple conditions.

    Thanks WarrenBelz,

     

    It worked fine 

     

    rgds

    AD

  • Verified answer
    WarrenBelz Profile Picture
    149,102 Most Valuable Professional on 06 Mar 2022 at 07:55:00
    Re: Lookup will not work with multiple conditions.

    Hi @ajithd6368 ,'

    Firstly, you have three conditions on the IF statement - the last one will never trigger (I think you are trying to do the below). You can also do this assuming AssetNumber is a Text field (not numeric) and Completed is a Choice field.

    UpdateContext(
     {
     RecValid:
     !IsBlank(
     LookUp(
     AssetTransactions, 
     AssetNumber = Self.Text && 
     Completed.Value = "Complete"
     )
     )
     }
    );
    UpdateContext({MakeItRed: !MakeItRed})

     

    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

     

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

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473

Loading complete