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:
SharePointFormMode = “CreateForm”,
drpFormStartedBy.Selected.Value = “Employee”,
Claims: “i:0#.f|membership|” & varUser.Email
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:
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?
If you have an email address, you can get the displayName from the connector with:
Keep up to date with current events and community announcements in the Power Apps community.
A great place where you can stay up to date with community calls and interact with the speakers.
Check out the latest Community Blog from the community!