First of all let me say that I am working in SharePoint 2013 via an Enterprise Server. Originally, I tried the "User Information List" steps that Laura Rogers authored but the fields would populate only in the form preview but not even the field names would show up on the form when opened in SharePoint - the space where the fields were supposed to be was totally blank.
So after going back over my work and checking everything over and over, I scratched that process and created a GetUserProfileByName secondary data connection/added the following "text" fields: First & Last Name, Email Address, Job Title, and Phone to the "Main" fields in InfoPath; and to the SharePoint list - although I don't need the fields to appear in the list (as the default Modified By field captures the user information) but for good measure I added them to the list anyway. NOTE: I want to make the user experience as easy as possible - especially for busy manufacturing engineers, so when the user opens the form their information is already there - I feel like filling out the rest of the form would seem fun (corny I know, but it's all about the user right?).
Okay, so the method I used is based around Form Load; conditions and rules and setting the value of each field via the call to the User Profile Service to get the user information. After I set up the condition to Get User Information if AccountName is blank, I made the Web service call the User Profile service to get the user information by repeated the following steps for each field - First Name, Last Name, Email Address, Job Title and Phone:
1. I created a rule to query for data (GetUserProfileByName(Secondary))
2. Set up Actions to run that would Set a field’s value - selecting the Field Icon selector
3. In the Select a Field or Group window, ensuring that the "Main" fields is selected....expanded the dataFields until I found the field I wanted to set, for example "Last Name" and click OK
4. Created a Formula via the formula icon
5. From the Insert Formula window, I selected Insert Field or Group…and change the Fields value from Main to GetUserProfileByName (Secondary)
6. Expanded the dataFields until I found Value, then clicked Filter Data…clicked Add to bring up the Specify Filter Conditions window and from there change Value to Select a Field or Group…select Name, and clicked OK, then changed the last drop down to Type text…and typed LastName, and click OK - Repeating these steps for each field.
In InfoPath preview the fields populate (as the loggin user - my info appeared just fine) but when I save and publish to the SharePoint library, the fields appeared but they are empty!! I thought it had something to do with the form Trust Settings being that I am working in an Enterprise SP server environment etc. especially since I am calling up User Information that is probably considered confidential, so I published it for administrative approval, but then again I thought maybe I didn't need to do that since the only person that will see the user information is the logged In User. SP/InfoPath help is kinda slow and unpredictable where I work, .....
I've created a vey nice form that would save the business a lot of time and create a dynamic business process....I've spent a lot of time creating this form and I so want to get this puppy up and running as I would also run a workflow with this form...So, I signed up with you guys to see if I could get more help in the event its just a step that I missed.
Thanks for your help!
Pulling My Hair Out - Kim
KN