PowerApp from showing CurrentUser

%3CLINGO-SUB%20id%3D%22lingo-sub-733709%22%20slang%3D%22en-US%22%3EPowerApp%20from%20showing%20CurrentUser%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-733709%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3EI%20am%20confused%2C%20i%20have%202%20forms%20in%20Powerapps%20and%20they%20seem%20to%20be%20similar%20in%20structure.%3C%2FP%3E%3CP%3EOnVisible%20i%20am%20setting%20CurrentUser%20thus%20%3A-%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CEM%3EUpdateContext(%7B%20%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3ECurrentUser%3A%20%7B%20%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E'%40odata.type'%3A%20%22%23Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser%22%2C%20%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3EClaims%3A%20%22i%3A0%23.f%7Cmembership%7C%22%20%26amp%3B%20Lower(User().Email)%2C%20%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3EDepartment%3A%20%22%22%2C%20%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3EDisplayName%3A%20User().FullName%2C%20%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3EEmail%3A%20User().Email%2C%20%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3EJobTitle%3A%20%22.%22%2C%20%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3EPicture%3A%20%22.%22%20%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%7D%20%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%7D)%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20the%20field%20on%20the%20form%20i%20am%20setting%20default%20to%20CurrentUser.%3C%2FP%3E%3CP%3EIn%20one%20form%20i%20have%20it%20working%20perfectly%2C%20in%20the%20other%20form%20it%20still%20brings%20up%20a%20drop%20down%20for%20a%20choice%20from%20the%20Person%20or%20Group.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20have%20I%20missed%3F%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F121874i2AE4E55565D593EF%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22nouser.PNG%22%20title%3D%22nouser.PNG%22%20%2F%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F121873iDC37D7B71A87CA1D%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22yesuser.PNG%22%20title%3D%22yesuser.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EScreenshots...%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-733709%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EPowerApps%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Highlighted
Occasional Contributor

Hi,

I am confused, i have 2 forms in Powerapps and they seem to be similar in structure.

OnVisible i am setting CurrentUser thus :-

 

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: "."
}
})

 

In the field on the form i am setting default to CurrentUser.

In one form i have it working perfectly, in the other form it still brings up a drop down for a choice from the Person or Group.

 

What have I missed?

nouser.PNGyesuser.PNG

Screenshots...

1 Reply

Hi @DeveloperCYT

 

Unsure what the issue is from what you have displayed. There may something happening that could be causing issues not seen on the screen.

 

You could possibly just add a text box and set it to current user, and then have the Person field reference the textboxname.text to grab the username. Make sure to make the Person field invisible so only the text box is shown.

 

It's a workaround but sometimes it's easier to do that than to figure out the problem itself.

 

Best wishes

Damien