SharePoint - How to set InfoPath people picker value programatically?

Asked By Prasanna Belsare on 24-Sep-14 08:41 AM

I am working with InfoPath forms. I am fetching SharePoint user's AccountIds from MS-SQL table and want to set those in InfoPath people pickers. How to set AccountId string value to InfoPath people pickers using c# code?


I have tried following, but doesn't worked for me:

XPathNavigator ManagerAccountId = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:ProjectManager/pc:Person/pc:AccountId", NamespaceManager);

ManagerAccountId.SetValue(strManagerDomainId);


XPathNavigator ManagerAccountType = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:ProjectManager/pc:Person/pc:AccountType", NamespaceManager);

ManagerAccountType.SetValue("User");