Login to PowerApps using Sharepoint Credentials

2k views Asked by At

I have created a PowerApps and now I want to login using SharePoint credentials.

I used this formula on onSelect of login button If(LookUp('Account Name', Title = Username.Text, Password ) = Password, Navigate([@Screen1], ScreenTransition.Fade))

Here Account Name is my DataSource , Title and Password are columns in DataSource.

So how can i achieve this?

1

There are 1 answers

0
Kala On

Let me see if I understand your question properly.

You have a SharePoint List of something like below.

list

And a login page like this

loginpage

on click on Signin button you want to verify Account and password exists in the list and let the user navigate to a welcome page.

Assuming the above scenario is what you want, the onSelect would look like this:

If((LookUp('list-test',AccountName = TextInput1.Text).Password = TextInput3.Text), Set(errorMessage, "");Navigate(Screen2,ScreenTransition.Fade), Set(errorMessage, "Wrong account name or password"))

  • 'list-test' - will be replaced by your datasource name
  • AccountName - will be replaced with whatever column name in sharepoint list that contains the account title
  • TextInput1 - will be replaced with the name of the TextInput that will contain the account name in login page
  • Password - will be replaced with the name of the column in sharepoint list that contains the passwords
  • TextInput3 - will be replaced with the name of the TextInput that will contain the user Input password
  • errorMessage - this is a global variable I set to display an error message in case of failure
  • Screen2 - will be the screen that you will take user to after successful check

In my example I have a label (label3) whose text is bound to that global variable errorMessage in case of error.