Hello Guys,
I want to update a Colum field in SharePoint when a button is selected. As a example.
Column1 has a Value "True". When user confirm button the value should be "false".
Is it also possible to Update the field with the Username with the User().FullName function?
Thanks in forward and best regards
Hi @Belasor,
This is because that Office365Users.UserProfile(InfoAbout.Text).DisplayName is used for Office365 user connector. The user profiles need to be extracted from AzureAD, you cannot use it on SharePoint person/group column.
Regards,
Mona
Thank you for your great answer.
But I have a problem with the _UserProfile.DisplayName function. It´s also not working with
In the SharePoint list "bookedby" is a person/group column
I tried it with a single line column and it´s working but i would like to have this into a Person column. Is it possible?
Thanks in forward.
Hi @Belasor
Yes it is posible, you can use Patch() function for this.
To update your record you will need to put forumla similar to this in your Button.OnSelect property:
Patch( YourSharePointList, Gallery1.Selected, { Column1:false, ColumnUser:User().FullName } )
In Patch() function first you say which list to patch (YourSharePointList).
Then you specify which record in that list to patch (Gallery1.Selected), if your items are not from gallery. You can do a lookup to find the record to patch:
Patch( YourSharePointList, LookUp(YourSharePointList,IDColumn = IdentificationVariable), { Column1:false, ColumnUser:User().FullName } )
Where IDColumn is a column in SharePoint List with which you can identify records and IdentificationVariable is a variable assigned in PowerApps to match records.
And then you specify which columns to change.
Some notes:
User() function can sometimes slow down your app and it is suggested to save your current user into a global variable and use through the app.
To do this you would put something like this in the Screen.OnStart or OnVisible property:
Set( _UserProfile, User() )
Then you can just use _UserProfile.DisplayName to get the name or _UserProfile.Email to get email.
WarrenBelz
146,522
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,890
Most Valuable Professional