I am uable to set a person field to the current user in a PowerApp. I have followed the tutorial below but the dropdown control is not set to current user. This approach seems to be the general consensus on how to do this. I must be missing a step.
http://www.codeovereasy.com/2017/07/powerapps-set-sharepoint-person-field-to-current-user/
OnVisible property of my screen:
//Here I am setting the person field record to a variable 'myself' with current user values
Collect(Collection1, {Pressed: Button1.Pressed});
UpdateContext({
myself: {
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims:"i:0#.f|membership|" & Lower(User().Email),
Department:"",
DisplayName:User().FullName,
Email:User().Email,
JobTitle:".",
Picture:"."
},
manager: Office365Users.ManagerV2(Office365Users.MyProfile().Id).mail,
varAlwaysTrueForTest: true})
Default property of person field dropdown control:
//This should show the current user in the dropdown control after the screen becomes visible
If(varAlwaysTrueForTest, myself, Parent.Default)
Update property of person field DataCard:
//DataCardValue6 is my person dropdown control
If(varAlwaysTrueForTest, myself, DataCardValue6.Selected)
Result - should be populated with current user