Prefilling user information on an InfoPath form from SharePoint

G

Guest

Hi,

I'm trying to pre-fill a few InfoPath form fields from the current
user's profile (the person filling the form). These include fields like
full name (i.e. not username), email address, work phone number,
department, etc. They are all fields that are stored by SharePoint. How
do I go about doing that?

So far I have tried setting up a data connection to the User
Information List on my SharePoint box:

One of the fields I'm bringing back is User_name. When setting the
default value on say, the Department textbox, I filter the Department
field returned from SharePoint by comparing the User_name field with
the UserName() function. This results in the following XPath:

xdXDocument:GetDOM("User Information
List_FormTopSection")/dfs:myFields/dfs:dataFields/dfs:User_Information_List/@Department[../@User_name
= xdUser:get-UserName()]

This seems to work fine if the UserName() function returns exactly the
same value (including case) as the usernames contained in the list. The
problem is that UserName() seems to return the current user name in
lower case. If the username held in SharePoint is not all lower case,
no data is returned.

I guess me questions are:

1. Am I missing something obvious and are in fact trying to reinvent
the wheel?
2. If this is the way to do it, how do I match username's regardless of
case?

Any help appreciated!

Regards,

Will du Preez
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top