Hi . I have a question that sounds like complicated.
Let me explain.
First off, I have created a login page in power apps which contains username and password (That's page 1 in that application)
Secondly, The username and password is saved in a SharePoint list which is used to authenticate username and password.
So after the user logins , it will navigate to second page. and in second page, i want that user name to be displayed in top right corner.
In power apps, i have wrote a code to display user details
let me show the code below
--------------------------------------------------------------------------------------------------------------------
If( !IsBlank( LookUp( logindatabase, Title = Usernametxt.Text && Password = Passwordtxt.Text ).Password ), Navigate(Content_Generation),Reset(Usernametxt);Reset(Passwordtxt));
Set(varUserRecord, {});
Set(varUserRecord, LookUp(logindatabase, Title=Usernametxt.Text && Password=Passwordtxt.Text));
If(IsBlank(varUserRecord.ID),
Notify("Invalid username or password", NotificationType.Error, 3000),
Notify("Successful Login", NotificationType.Success, 3000);Navigate(Content_Generation, None)
)
--------------------------------------------------------------------------------------------------------------
So in next page, whenever user logins , i can display their name in top right corner
"Welcome User " & varUserRecord.Title & "!"
----------------------------------------------------------------------------------------------------------------
Is it possible to do the same in power automate?
also, using power automate, i have to save the username in sharepoint, who has logged in.
so how to do this process?
pls guide me in detail how to do that.
Hey @Jupyter123
Yes its possible to do the same in Power Automate.
So, whenever a person clicks on login button, you should run the flow.
From that button, also send the username and password.
Then with the help of condition action, check if username and password is correct or not.
If it is correct, send something to the power app, by which if it matches, it would take the user to the next screen. And also at this point store, the username of the person, to maintain who has logged in power apps.
If they do not match, send something to the power apps, that will not let the power app to go to the next screen, and shows a message username or password incorrect.
You should probably return 1 and 0.
If the returned value is 1, everything matches and you should take the user to next screen.
If the returned value is 0, username/password did not match and you should show a message that, something didnt match.
This is how your flow would look like:
I have added a variable, which will note that username and password matched or not. It will act like a flag variable like other programming languages.
Used get items to get username and password. If the flow runs really slow, then you will have to use filter query.
After that use a condition action and use username coming from power apps and username coming from get items, this will create an apply to each.
If the username didnt match, set the variable to 0.
If the username matches, add another condition action, to match the password.
If the password doesnt match, set variable to 0.
If the password matches, set variable to 1 and use create item, to make an entry for the user logged in.
At the end just add respond to power apps action and pass the match variable in it.
I hope this will help.
User | Count |
---|---|
25 | |
14 | |
12 | |
10 | |
9 |
User | Count |
---|---|
51 | |
29 | |
28 | |
24 | |
22 |