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

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
Super User
Super User

Re: Loggin screen connected to an excel table

Hi @GiovanniMugno 

Here's a similar thread on this issue:

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

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
Super User
Super User

Re: Loggin screen connected to an excel table

Hi @GiovanniMugno 

Here's a similar thread on this issue:

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

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

GiovanniMugno
Level: Powered On

Re: Loggin screen connected to an excel table

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.

Super User
Super User

Re: Loggin screen connected to an excel table

Hi @GiovanniMugno 

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.

GiovanniMugno
Level: Powered On

Re: Loggin screen connected to an excel table

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


@timl wrote:

Hi @GiovanniMugno 

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
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,316)