In this blog Post we will learn, How to Set Combo Box Default to Current User and Save in SharePoint List Person column in the Canvas app form inside PowerApps and how SharePoint set default value for person or group column inside the SharePoint form
Person Column is In SharePoint Online is used to retrieve user or group value. This field can be set up to only retrieve users from a specific SharePoint group or to accept any value from the authentication provider. Users can be Found with either their name or email address.
Some times in PowerApps we need to set the default value of a combo pox that hold persons “users’ to the current user for a new record.
Set Combo Box Default to Current User and Save in SharePoint List Person column
The Data type of the person column in the combo pox must be Record data type, so we have to path a record that indicate the current user name and claims, you can use the below formula to set the DefaultSelecetedItems of the combo box to the current logged in user in PowerApps.
Claims: is an object that contains the information of a person
{
DisplayName: User().FullName,
Claims: "i:0#.f|membership|" & Office365Users.MyProfile().UserPrincipalName
}
SharePoint set default value for person or group column
If you want to customize the SharePoint form and use current user as default value in a Person or Group field in SharePoint list
- from the SharePoint list click Integration> PowerApps and select Customize forms to customize this SharePoint form in PowerApps studio.
- In the Onvisible property of the form set the formula to get the current logged in user.
UpdateContext({
CurrentUser: {
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims: "i:0#.f|membership|" & Lower(User().Email),
Department: "",
DisplayName: User().FullName,
Email: User().Email,
JobTitle: ".",
Picture: "."
}
})
- Set the DefaultSelectedItems property of the combo box to be CurrentUser
- Then publish this customization to PowerApps, and ten you will see the current logged user displayed in your form
Join us
- Subscribe to Power Platform Geeks.
- Register to Saudi Arabia Power Platform User Group.
Need Help
- Have a related question? Please ask it at deBUG.to Community.