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

Community site session details

Session Id : nBD82rjkkToRcKc4obzezD
Power Apps - Building Power Apps
Answered

If Statement Error

Like (0) ShareShare
ReportReport
Posted on 13 Aug 2022 01:04:12 by 314

I am trying to apply the username and password function to my app and I am getting an error I cannot figure out.  Please help me figure this out.

 

This is the code I am using on a button (OnSelect):

 

If(!IsBlank(LookUp(DataSource, Title=TxtUserName.Text And Password=TxtPassword.Text), Navigate('Screen2'), UpdateContext({ShowForgetMessage: true})))

 

 

I am not getting any red error lines.  Instead I am getting two App Checker errors:

Error 1: Invalid number of argument: received 3, expecting 1

Error 2: Invalid number of argument: received 1, expecting 2 or more

 

 

 

 

I have the same question (0)
  • WarrenBelz Profile Picture
    149,482 Most Valuable Professional on 13 Aug 2022 at 03:18:27
    Re: If Statement Error

    Hi @Alex-W ,

    You can use any field in the record that would not be blank if the record exists with the LookUp.

  • Alex-W Profile Picture
    314 on 13 Aug 2022 at 02:51:28
    Re: If Statement Error

    @WarrenBelz Disregard my second question about the code not work.  I signed out of Power Apps and went back in and its working now.  Not sure what's going on with my tenant at the moment.

  • Alex-W Profile Picture
    314 on 13 Aug 2022 at 02:30:35
    Re: If Statement Error

    Hello @WarrenBelz 

     

    Thanks for the help.  The errors went away, but I have questions.  I saw that you added .Title after the lookup section.  Is this what you mean by testing a field rather than a record?

     

    Also, this is not working like the tutorials I saw online.  When I tried to test it, the forget password label that I setup is popping up when I press the enter button to send the username and password even though I am using the right information.  Is there something else I need to configure?

  • Verified answer
    WarrenBelz Profile Picture
    149,482 Most Valuable Professional on 13 Aug 2022 at 01:41:36
    Re: If Statement Error

    Hi @Alex-W ,

    Just some bracketing and it is always good to test a field rather than a record

    If(
     !IsBlank(
     LookUp(
     DataSource, 
     Title = TxtUserName.Text And Password = TxtPassword.Text
     ).Title
     ), 
     Navigate('Screen2'), 
     UpdateContext({ShowForgetMessage: true})
    )

     

    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Telen Wang – Community Spotlight

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

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