On my app I have a dropdown with two values: Employee and Instructor. I also have two people picker fields - one to store the name of the employee and one to store the name of the instructor.
Based on which option is chosen in the dropdown when the form is in new mode, I would like the appropriate people picker to be populated.
Right now on the Employee people picker’s DefaultSelectedItems value I have:
If(
SharePointFormMode = “CreateForm”,
If(
drpFormStartedBy.Selected.Value = “Employee”,
{
DisplayName: varUser.FullName,
Claims: “i:0#.f|membership|” & varUser.Email
}
),
Parent.Default
)
The variable varUser is set OnNew to User().
This does put my name into the Employee people picker but as FirstName LastName. When I normally pick a name from a people picker it comes back LastName, FirstName.
Now the form DOES seem to populate my name in the list properly but the problem is that I also want to patch this value to a child list. On the OnSuccess value of my form I have:
Set(
varEmployeeName,
drpEmployeeName.Selected.DisplayName
);
and then my ForAll patch statement references that variable. And it’s returning the FirstName LastName value.... I need this to be LastName, FirstName as in our active directory.
I created a data connection to Office365Users but I’m not sure if that’s part of the solution or not...
Thanks in advance for any guidance!
Yes, instead of using the User().xxx information, get your information from the Office365 User connector. It should reflect the DisplayName in the format you are looking for.
I hope this is helpful for you.
I’ve been researching how to get this to work with the Office365Users connector and I still can’t figure it out. Forgive me, this is my first app! Can you possibly step me through this with some sample formulas for me?
No problem.
If you have an email address, you can get the displayName from the connector with:
Office365Users.UserProfileV2(<emailAddressHere>).displayName
I am trying to reply and it won't let me, it keeps saying there are HTML errors in my message. I just can't get this to work.
User | Count |
---|---|
263 | |
110 | |
92 | |
55 | |
41 |