cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Adam51
Frequent Visitor

Creating a "Sign In Page" using data from an Excel formatted Table

I'm trying to create a login page for a student project using credentials that are stored in an excel table. The data has already been formatted into a table ('Capture') and has already been linked to the "data" section of PowerApps. The code used in the screenshot 'Capture2' is what I found from other tutorials. 'Capture3' is the text I want to be displayed to the user upon an unsuccessful Login however it seems to pop up regardless even when the correct user credentials are inserted into the text inputs. I am unsure where to go from here

5 REPLIES 5
LRVinNC
Super User
Super User

The problem is the way the email address is coming in.  I created a similar table.  If you you look at the data actually in the table, you will see that Excel is appending mailto: on the front of each email address. 

PW1.jpg

This appears to occur even if you enter the email address as text, not a hyperlink.  So the easy solution to this is to simply append this same value to the text entered.

 

If(Concatenate("mailto:", TextInput1.Text) in Table1.UserID && TextInput2.Text in Table1.UserPassword, Set(GoodPW, true), Set(GoodPW, false))

 

This results in a successful match (as indicated by the value of GoodPW being set to true) when email1@test.com and Password1 are entered in the two text blocks.  I display OK when true and Not OK when false to validate.

PW2.jpg

 

 

LRVinNC

------------------
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.
Adam51
Frequent Visitor

I added the new code to the 'OnSelect' function however the label I have set to display when there is an unsuccessful login still displays even though the textinput1 matches the data within the excel document

LRVinNC
Super User
Super User

Use the formula bar to view exactly what PowerApps is seeing.  Go to you button OnSelect and then highlight the Table1.UserID portion.  It should bring up a small > pointing down.  Click to expand and you should see exactly what has been loaded from the table.  
pwe.jpg

 

Repeat with the TextInput field to see exactly what PowerApps thinks is in the two fields. 
Then repeat, if necessary with the Password fields.
Send me screenshots if that doesn't show you the disconnect.

 

LRVinNC

------------------
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.
Adam51
Frequent Visitor

(I changed UserEmail to UserID in excel and PowerApps before this screenshot was taken thinking it could be a naming issue)

Despite there being a successful connection between the excel dataset and PowerApps, it is displaying that no data could be found. I deleted the connection then re-established it however the same issue persists

LRVinNC
Super User
Super User

I  believe that is because your actual column name in the excel file is UserEmail, not UserID.  UserID was what I used in my test file.  Try modifying the formula to replace UserID with UserEmail and then try this again.

 

 

LRVinNC

------------------
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.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (65,225)