cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Loggin screen connected to an excel table

I have this problem: I have a login screen with two text entrys, "UserEntry" and "PasswordEntry", and i want to make the verification via an excel table in the app, the table it's named "Users" and it has the columns "UserName" and "Password", i need to compare if the UserEntry.Text is equal to one of the UserName registered, and if the Password.Text matchs the corresponding UserName Password column, if it's correct, it will send you to another screen, but if the username, and/or the password are wrong, then a invisible label with an error text will turn visible.

 

It's any form to do this? if not, how can i make it throught another way like making a collection? (and not making an infinite If inside the button with all the passwords and usernames).

And thank you in advanced for your responses!.

1 ACCEPTED SOLUTION

Accepted Solutions
timl
Super User
Super User

Hi @Anonymous 

Here's a similar thread on this issue:

https://powerusers.microsoft.com/t5/General-Discussion/where-validate-username-and-password/td-p/271249

To implement this, you can add the following formula to your Login button.

If(CountRows(Filter(Users,And(UserEntry.Text = UserName,PasswordEntry.Text = Password))) = 1, 
   Navigate(TheScreenThatYouWantToNavigateToOnSuccess), 
   Notify("Incorrect Login Details",NotificationType.Error)
)

As a sidenote, I really recommend against the idea of storing usernames and passwords in Excel, or any other data source.

In order for this technique to work, all users will require access to the underlying Excel spreadsheet. Therefore, any user can circumvent the security by directly opening the spreadsheet and looking up the usernames/passwords. A far better way to secure your app is to use the built in sharing functionality and to only share your apps with users that require access to your app.

View solution in original post

4 REPLIES 4
timl
Super User
Super User

Hi @Anonymous 

Here's a similar thread on this issue:

https://powerusers.microsoft.com/t5/General-Discussion/where-validate-username-and-password/td-p/271249

To implement this, you can add the following formula to your Login button.

If(CountRows(Filter(Users,And(UserEntry.Text = UserName,PasswordEntry.Text = Password))) = 1, 
   Navigate(TheScreenThatYouWantToNavigateToOnSuccess), 
   Notify("Incorrect Login Details",NotificationType.Error)
)

As a sidenote, I really recommend against the idea of storing usernames and passwords in Excel, or any other data source.

In order for this technique to work, all users will require access to the underlying Excel spreadsheet. Therefore, any user can circumvent the security by directly opening the spreadsheet and looking up the usernames/passwords. A far better way to secure your app is to use the built in sharing functionality and to only share your apps with users that require access to your app.

Anonymous
Not applicable

Wow, thank you! that solved the problem for my login button 🙂 the thing is, is not going to be a public app, it's going to be a private app with 2 types of users, admins and interns, so i needed the login for put the difference between those two, if putting the excel information in the app is not that secure, what will you recommend? i have all the information of the app (the login and the inventory info) in Excel tables, all linked throught an account of Onedrive.

Hi @Anonymous 

Sorry for the delay in responding. Adding this type of role managment on apps based on Excel/OneDrive is difficult because of this issue.

The most secure workaround would be to create 2 apps - one for users, and the other for admins/interns. You would then share the admin app with only the admin users. If you have any data that only admins can access, you can store this in a different Excel spreadsheet and configure your Onedrive settings so that only admin users can access the spreadsheet.

Anonymous
Not applicable

Well, thank you for the tips, it will become very handy in the future, you helped me a lot!


@timl wrote:

Hi @Anonymous 

Sorry for the delay in responding. Adding this type of role managment on apps based on Excel/OneDrive is difficult because of this issue.

The most secure workaround would be to create 2 apps - one for users, and the other for admins/interns. You would then share the admin app with only the admin users. If you have any data that only admins can access, you can store this in a different Excel spreadsheet and configure your Onedrive settings so that only admin users can access the spreadsheet.


 

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (2,375)