The first thing to create is the source list. Meaning the list that ties the user account to the data I wish to prepopulate in my list. Create a SharePoint Custom list (in my example titled: Source List) with the following columns: Department column (single line of text), and then a Users column which is a Person or Group column. (Please note for the Show field option at the bottom of the Person or Group column, select Account- this is specifically for Office 365 SharePoint):
Now, it is time to create the list that this information will be supplied to. Just for an example, I will create a list titled Comments with the following columns: Submitter Name (single line of text), Department (lookup to the Source list created above utilizing the department column) and Comments (mulitiple lines of text):
From the Ribbon bar at the top, select the List tab:
Select Customize Form in the Customize List section (Please note for this feature to be enabled, InfoPath Designer 2010 must be installed on the computer) :
InfoPath Designer 2010 will open the form for the Comments list.
The first thing needed is to prepopulate the Sumitter Name column with the Account Name from the logged in user. There are several ways to approach this and one of the simplest (because I like simple) is to set the default value of the Submitter Name column from a Form Load Rule.
On the Ribbon Bar in InfoPath, select the Data tab:
Then select Form Load in the Rules section:
Under the Form Load Rules, select the New drop down and then select Action:
Enter text to the Details for column (in this example I entered PopulateSubmitterName to remind me of the purpose of this rule):
Leave the Condition as the default and Rule type is Action. Select the Add drop down and select set a Field's value:
and select the name of the field to pre-populate - in this case Submitter Name.
On the Insert formula screen, select Insert Function:
Select Insert Function:
For Categories, select User and then for Functions select userName and select Ok 3 times:
Finally, Quick Publish the new form to the list by selecting the icon at the top of the page:
Now when the form loads, the User Name is displayed: