Forum Discussion
Auto populate person field with current user - InfoPath
http://www.qdoscc.com/blog/how-automatically-retrieve-current-username-infopath-sharepoint-list-form
Pieter Veenstra, I am using SharePoint Online/Office 365 - is there another way to accomplish this? I was told we have E3 license but I was not able to access the path. I have admin rights.
https://myHostSite/sites/mySite/_vti_bin/UserProfileService.asmx
Are there any settings, on SP, I need to enable to access it? Thanks.
-----
Edit: Nevermind. I got it to work by using UserName() as the default value of the people picker (AccountID).
- Daniel PaulMay 09, 2018Copper Contributor
Hi. How did you get the 'UserName()' function to stet the value of people picker field? I tried doing this and it simply won't set.
- Michael BoonieNov 20, 2018Copper Contributor
I have the same issue: In fact, I can manually set the all three values of the repeating 'pcPerson' group (DisplayName, AccountID, and AccountType) and a repeating table bound to the repeating 'pcPerson' group shows the values that I set (which, after testing, I verified as equal to values I'd get if I actually used the People Picker control); yet the actual People Picker control stays blank!
I did extensive testing to tell it's not quite "set," but it's still very confusing. Because one can't set a rule on a People Picker control, I used the time-honored trick of binding a text field ('strRequestorID') to the AccountID of the picker and setting a rule on THAT field. The rule--which apparently is being triggered--uses one of the values (DisplayName) from the Picker control to set a different value elsewhere; but the value being retrieved is blank, which is mighty confusing in itself, because the rules is only supposed to run when it's NOT blank!
At this point, I'd even welcome a workaround, although I'd really like to know what's going on.
- BenSteginkMar 07, 2019Steel Contributor
Were you ever able to figure this out? I'm in the same boat right now...
- Michael BoonieMar 08, 2019Copper Contributor
I'm afraid I have not. In fact, I just had to deal with this again, yesterday.
Fresh eyes did not help.
I'm using SPO, and it's the same regardless of which of four browsers I use. (And I find it philosophically offensive to prompt the user to select their own name, instead of being able to default to it.)