Thursday, March 10, 2016

InfoPath 2010: concatenating account IDs to show on a single field from a SharePoint secondary data connection with a Person field set to allow multiple

When a multi user person field in a SharePoint list comes over to InfoPath as a secondary data connection, the Person field is a repeated field and as the account IDs are under it, also shows as a repeated field.  This is evident if you just drag that field from the Fields screen onto the form. 

To get the accountIDs to show in one field, we will utilize the eval() and concat() functions:

where 'AccountId' is the under person field you want to concat (obviously).  Here we are using claims authentication with SharePoint, so have to use the substring function to remove extra chars "i:0#.w|". 

End result will be as follows:
<domain>\user; <domain>\user2; <domain>\user3