I have a Person or Group field on a form, that I am setting to the current logged in user
fd.field("Employee").value = _spPageContextInfo.userLoginName;
When I check the value, I don't get all of the "extra" information like if I picked the person from the list, I only get the persons email:
fd.field("Employee").value
'user@domain.com'
vs
fd.field("Employee").value
Description:(...)
DisplayText:(...)
EntityData:(...)
EntityType:(...)
IsResolved:(...)
Key: (...)
MultipleMatches:(...)
ProviderDisplayName:(...)
ProviderName:(...)
parent:(...)
uid:(...)
So my question is, is there an equivalent to reloadValue() like there is on a Lookup field?
Hello @sphilson ,
No, there is no function for this. And why do you need it?
You can get current user properties in the _spPageContextInfo like:
//get display name
_spPageContextInfo.userDisplayName
//get email
_spPageContextInfo.userEmail
If you need other properties use PnP js function:
Use JavaScript to populate fields with information about the current user such as name, job title, department, phone, manager name and more
In my actual use case, I have a field that a populate with the Users Manager (which I find by calling a Flow). There are times where I may need to get additional information off of the Manager field like the User Id, or Display Name, etc.
@sphilson ,
In this case, the PnPjs function is the best option. You can also get the user manager name with it:
Use JavaScript to populate fields with information about the current user such as name, job title, department, phone, manager name and more