Sometimes you just want to use more information like just the user id within your InfoPath form. Now you are able to use the SharePoint webservices but it is also possible to query the userinformation list in SharePoint. The result looks like this:
To achieve this goal it is just a few clicks away. What we need is a data connection to the relevant SharePoint. In my case I retrieve this data from our mysite url.
Be sure that the following options are unchecked:
Now we need a Form Load Action to set query parameter for the new data connection. Something like this:
And we also need to query the data connection to retrieve the relevant user information:
At least you need to create your form. You need a repeating table if you will show more than one result. But if you only show up the current user information you just add the dataFields of your secondary fields section.
That’s it!
..:: I like SharePoint ::..
Great Article! I like it!
Greets,
Anni from Sharepoint
Hi, Nice article. I tried this but couldn’t get it working. I do not know what seems wrong, no error message, is just that no returned data from my sharepoint server. I’m using infopath 2013 and sp2013.
thanks in advance.
Thanks for the info, I have it almost working but it get all users, not just the current user. Any suggestion?
Did you set the query parameter while the form is loading? You have to set it to “current user” or something else to get only one user. After that you have to load the query manually.
Have you tried to this without using the filter? Just query all users within the user information list?
Thanks for your reply!
Hi Dennis
Can you please go into more details regarding the data fields setup. Like which user did you user in the set field value. My data fields only have repeating tables so it retrieves all the user instead of one.
Please help
Thank You
Within the set field i use the function
userName()
after that you need to load this query for the information list again with
does this help?
Hi,
I found solution for error in InfoPath 2013
User name from userName() function is returned in format : i:0#.f|membership|firstName.lastName@Contoso.com
and username in query takes format: firstName.lastName@Contoso.com
Fast update:
In InfoPath 2013 query field Name is in same format as returned by userName() function.
Nette Sache solange man das Formular im InfoPath startet. Aber sobald es auf der SharePoint-Bibliothek veröffentlicht wird, erscheint nichts. Der Abschnitt wird gar nicht angezeigt und ein einzelnes Feld bleibt leer.
Hi, How did you accessed the UserInformationList in MySIte?
if I want to populate the email address of a user that is not the current user which cannot be pulled from AD, I can use the User List. What are the rules to populate the email address for an “other than” current user?
i used your guide and i set text box control on my form. in default value of this control i set user name field from User information list (Secondary) but i cannot receive username of current user