Forum Discussion
Allison Rizak
Jan 12, 2017Copper Contributor
Auto populate person field with current user - InfoPath
I've seen this done, so I know it's possible, but I just wasted an hour searching on the internet, hoping to figure out how to do it. I want the current user to be automatically added to the People f...
Michael Boonie
Nov 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.
BenStegink
Mar 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.)
- Tamras1972Mar 08, 2019Iron Contributor
It's been awhile and we're no longer using InfoPath so I hope my recollection below is correct. In form load, add a rule that if ID is blank (i.e. new form), set a text field (i.e. CurrentUser) value to equal UserName(). Then set the people picker (AccountID) value to this field (CurrentUser). If I remember correctly, I had to use substring to remove any part of UserName() result to just give me the email address before I could use it as the value for the people picker. Hopefully this helps. If I find a copy of the old xml file, I'll try to post the exact solution.
- BenSteginkMar 08, 2019Steel Contributor
Yup, same here. It's weird...all the fields get set. I can even configure it all like that. Load the form, go into the people picker type a [space] and change focus and suddenly the user shows up in the people picker. It's like it loads all the data properly but never does that last callback/refresh to do the final load of the person into the people picker. It takes a manually change within the form for the person to be populated.