Wednesday, December 2, 2015

Recently had to dive back into Infopath 2010 and I had an issue where I wanted to display the value of a people picker for a record but essentially have it read only. Most of the solutions I found said to create a Text Box and assign it a value of the people picker. I hated this solution because it creates another column in the SharePoint list, forcing me to administer duplicate data. Blehg.

I found a better way. Much like the above solution but instead of a Text Box, use the Calculated Value control. All the same steps but instead the value is calculated at runtime instead of stored in a SharePoint list.

Steps:

Under the Home tab, look for Controls and click on Calculated Value. This will bring up the Insert Calculated Value dialog box.

Click on the function button (fx) bringing up the Insert Formula dialog box.

Click on the Insert Field or Group button bringing up the Select a Field or Group dialog box.

People pickers will not be displayed in the fields list. You have to click on the Show advance view link at the bottom of the dialog box to change the fields view.

What you should now see is a tree view of your data, most likely collapsed.

Expand dataFields

Expand my:SharePointListItem_RW and find your people picker field.

Expand your people picker field.

Expand pc:Person.

Click on DisplayName.

Click the Ok buttons until you are back to your form.

You now have a calculated value control which populates with that records people picker value without having to store or administer unnecessary data.