Issue
I needed to create an InfoPath 2003 form that pulled in AD user information (without code). This form was then to be published to a SharePoint 2007 library where a view was required that only displayed forms for the direct reports of line managers.
Resolution
I created the InfoPath form to pull in AD user information such as username, department and manager using this article. This works fine but the manager field is populated with DOMAIN\Username.
To strip out the “DOMAIN\” bit before the username use the substring-after command as detailed here. This gets the form looking neater, but when it is saved to the document library, the Manager field is created as ‘single line of text’.
I was going to use the filter [Me] on the manager field to show forms only where I was the manager. Thus showing me all forms relating to my direct reports. However you cannot filter using [Me] on this field type.
The workaround involves 2 steps;
1. create a new field in the library (call it say ‘line manager’) of the person or group type.
2. create a workflow in SharePoint designer to fire when a form is created to set ‘field’ [line manager] to ‘value’ [manager in the current item]. This is also described in greater depth in this article.
Now when a new InfoPath form is created, it is populated with the correct looking AD user information. This information is then used to populate an additional column in the list (this could also be hidden) which can be filtered using the [Me] switch.
Although this information is written elsewhere, it is in different places and this article pulls it together. Hope it helps…

No comments yet
Comments feed for this article