cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ash2
Level: Powered On

Custom Login

Hi All,

 

I'm trying to create a user login function in my app by looking at a SharePoint list or a data table of user and password i have created.

 

but when I use the function to see if the username/password is equal the username/password that's entered in the app, it dont not seems to work. 

 

If(And('SP.Username_Column1'=PA_LS_Username.Text,'SP.Passwrod_Column1'=PA_LS_Password.Text ),Navigate('Home Screen'),Navigate('Failed To Login Screen')) 

 

should i be using another method or is the function im using is incorrect ? 

17 REPLIES 17
Super User
Super User

Re: Custom Login

Are you taking into account that the check you are doing is case sensitive for both the userid and the password?



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Ash2
Level: Powered On

Re: Custom Login

@Pstork1 

 

since im using the below, it should be case sensitive for both correct?

 

If(And('SP.Username_Column1'=PA_LS_Username.Text,'SP.Passwrod_Column1'=PA_LS_Password.Text ),Navigate('Home Screen'),Navigate('Failed To Login Screen')) 

 

cos the function is checking if they the username/password that's being entered is the same whats in the database. 

 

Since the user info is in a data table, i should use a lookup correct?

 

Super User
Super User

Re: Custom Login

Hey @Ash2 

 

Can you try to update your expression as:
If(LookUp(SP,Username_Column1=PA_LS_Username.Text).Passwrod_Column1'=PA_LS_Password.Text ,Navigate('Home Screen'),Navigate('Failed To Login Screen'))
 
Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Ash2
Level: Powered On

Re: Custom Login

@yashag2255 

 

it does not seem to work with the below.

 

If(LookUp(SP,Username_Column1=PA_LS_Username.Text).Passwrod_Column1'=PA_LS_Password.Text ,Navigate('Home Screen'),Navigate('Failed To Login Screen'))

 

I made some adjustment to your formula but it still now working. 

 

If(and(LookUp(DataTable3,Username_Column1=PA_LS_Username.Text)=PA_LS_Username.Text,

LookUp(DataTable3,Username_Passwrod1=PA_LS_Passwrod.Text)=PA_LS_Password.Text),

Navigate('Home Screen'),Navigate('Failed To Login Screen'))

Super User
Super User

Re: Custom Login

Hey @Ash2 

 

Since you are creating a login page, then a specific username should match with the password entered, if you will apply an and condition here, this will check for the username and password separately and a user will be able to login all accounts using his/her password. That's why you need a single lookup in this case. Now, for the expression, are you getting any error when tried to use the below expression? If so, please share more details about the error.
 
If(LookUp(SP,Username_Column1=PA_LS_Username.Text).'Passwrod_Column1'=PA_LS_Password.Text ,Navigate('Home Screen'),Navigate('Failed To Login Screen'))
 
Here, I am assuming SP is the name of list with columns Username_Column1 and Passwrod_Column1. PA_LS_Username and PA_LS_Password are the controls to accept text input from the user.
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Ash2
Level: Powered On

Re: Custom Login

@yashag2255 

 

Sorry to say but that formula is not working Smiley Sad

 

Maybe the below pic can help.

Super User
Super User

Re: Custom Login

Hey @Ash2 

 

are you getting any errors? If so, please share more details about the error message.
 
Also, based on the screenshot shared by you, this shows the data in a data table. Do you intend to use data table here in the context? Please share more details so that we might be able to help you better.
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Ash2
Level: Powered On

Re: Custom Login

@yashag2255 

 

originally I was using a Sharepoint lIst to store the User info but I wanted the app to work offline as well, so I thought I would need to have a data table background somewhere in the app to check the user info. 

 

please see below pic, not a 100% sure if m looking in the correct place.new1 .png 

Super User
Super User

Re: Custom Login

Hi @Ash2 

 

Based on the error that you are getting it seems that there is a mismatch of the type in the arguments that are passed, can you please confirm the type of Username_Column1 and Passwrod_Column1? Please share more details on the type of columns in the SP list.
 
Even if you store the data in a collection, that doesnot affect the data types and the value should be passed in a manner that is same to type of attribute. Can you please once check the collection that all the values are stored as text?
 
Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 238 members 5,007 guests
Please welcome our newest community members: