I am creating a login page. the user puts in the username and password and clicks on the button "login". when he clicks on login, i want the PowerApps to go to the SharePoint, get the name from the list where username = username entered and save the result in a global variable
@v-dezhili-msft thank you dear there is no longer an error, but when i click on login for the next page,
I need on a screen load to have that name that was saved on the global variable to be shown automatically on top filling a label. when i click on the label, and choose text = global variable, it keeps returning as blank
Hi @ESAIT ,
Did you refresh the data source in Power Apps after you changed a field in a SharePoint list? You can also go to List Settings to see if the list names have been changed correctly.
Best Regards,
Dezhi
@v-dezhili-msft thank you for your assistance
i Named my columns same as your code with family name as LastName and First Name as FirstName
but Power App is not accepting them as per the attached
Hi @ESAIT ,
Do you want to get the FullName of this user from the SharePoint table by Username when logging in?
In my test my UserName, FirstName and lastName are all of type single line text in SharePoint table.
If(TextInput3.Text=First(Filter(list3,UserName=TextInput3.Text)).UserName,Set(varName,First(Filter(list3,UserName=TextInput3.Text)).LastName&First(Filter(list3,UserName=TextInput3.Text)).FitstName))
Best Regards,
Dezhi
@v-dezhili-msft I checked the code now and it is similar to the one i used to check if the username and password exist in the sharepoint, yet i need to fetch the Name based on the username and save the name in the global variable
@v-dezhili-msft thank you for your assistance
1. i want to save the name to display it in the next screen and to use it in future queries
2. Yes there is a username, password, first name, and last name
3. yes
i will test what you sent me and update you. thank you 😀
Hi @ESAIT ,
1. You just want to save the username to a global variable or a record of the username when the user logs in?
2. Is the user in your SharePoint table a person column?
3. Do you have a Password column in your SharePoint table?
In fact, there is a built-in global variable User() in Power Apps, which stores the information of the current Power Apps user. I did a test, in my scenario the user in my SharePoint table is a person column and I have a Password column. When I click on the login button I use filter() to find the username in sharePoint that is the same as the text input box, and compare the Password, if they are equal I use set() to save the username.
If(TextInput4.Text=First(Filter(list3,person.DisplayName=TextInput3.Text)).Password,Set(glo,TextInput4.Text);Navigate(Screen6),Notify("error"))
Best Regards,
Dezhi