Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Lookup will not work with multiple conditions.

(0) ShareShare
ReportReport
Posted on 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 at
    Re: Lookup will not work with multiple conditions.

    Thanks WarrenBelz,

     

    It worked fine 

     

    rgds

    AD

  • Verified answer
    WarrenBelz Profile Picture
    146,981 Most Valuable Professional on at
    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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Building Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 110 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 77

#3
stampcoin Profile Picture

stampcoin 52

Overall leaderboard