Friday, January 29, 2016

How to set default value for people picker

In general there is no straight way for pre-populating people picker, but don't worry always there is away! Here I'm going to explain how to do this using InfoPath.

Solution:

1- Open up your form in InfoPath and add a Data Connection

2-  Choose SOAP Web service:

3- Enter the location of SOAP; for SPO it's something like this: https://tenant/_vti_bin/UserProfileService.asmx

4- Choose GetUserProfileByName;

5- Go to Form Load and add an Action Rule and choose Query for data and select GetUserProfileByName

6- Then Add "Set a field's value" Action, from fields choose DiplayName of people piker (here it's Estimator) and click OK:

7- For value click on "Insert field or group" and then choose "Show advanced view":

8- Do following steps:

9- In Filter Data window select Name as shown in picture and click OK:

10- Enter PreferredName (Just type it as text) and click OK:

11- Add another "Set a field 's Value" Action, this time for filling AccountId, choose filed name as following image:

12- Set Name equal to "AccountName" (just type it as text):

13- Re-do step 11, this time for AccountType. Simply enter "User" in Value box:

14- Now rule should be like this:

15- Done ... Now people picker is like this:


by Sarah Safari via Everyone's Blog Posts - SharePoint Community

No comments:

Post a Comment