Поделиться через


How to display current user's full name, email and other info in InfoPath?

Itay has blogged the exact steps and screenshots on how to display current user info (email, full name, manager, etc) in InfoPath form by calling UserProfileService.asmx in MOSS 2007, most importantly without writing any code!

https://blogs.microsoft.co.il/blogs/itaysk/archive/2007/04/05/InfoPath-_2D00_-Get-the-current-user-without-writing-code.aspx

Note: 

I was getting the following error during my first try:

The query cannot be run for the following DataObject: GetUserProfileByName
InfoPath cannot run the specified query.
The SOAP response indicates that an error occurred on the server:

Server was unable to process request. ---> Attempted to perform an unauthorized operation.

 

Cause: I was calling the web service against the server root that I didn’t have access to. For example https://server/_vti_bin/userprofileservice.asmx but I didn’t have access to https://server

Solution: Call the web service against the site the InfoPath template lives in, which the current user has access to. For example https://server/sites/sitename/_vti_bin/userprofileservice.asmx

Comments

  • Anonymous
    August 01, 2007
    Recently had a situation in which we needed to access a specific field from the user profile object and

  • Anonymous
    August 01, 2007
    Recently had a situation in which we needed to access a specific field from the user profile object and

  • Anonymous
    May 26, 2008
    Hi Jingmei, I'm also having the same proble and I did I tried your solution, where I have an access in my sharepoint site, Infact I'm using my admin account which have a full control. I also have my form set to full trust. Is there any other option that I've missed? Thanks in advance. Joel

  • Anonymous
    July 14, 2008
    www.ceapet.com InfoPath-Getthecurrentuserwithoutwritingcode I'vejust

  • Anonymous
    September 12, 2008
    The comment has been removed

  • Anonymous
    May 14, 2009
    Get current user information in Infopath form

  • Anonymous
    June 25, 2009
    The logged in user must also have the "Personal Features" right in the Shared Service Provider to use an InfoPath form that calls the User Profile web service.  To manage Share Service Rights browse to: [your Shared Services Administration site]/ssp/admin/_layouts/ManageServicePermissions.aspx or click on the name of your Shared Services provider from left (Quick Launch) menu on the SharePoint Central Administration home page and then click on Personalization services permissions under the User Profiles and My Sites section.  

  • Anonymous
    April 05, 2011
    None of above worked for me. If I login using an account other than site admin, web service gives an error.

  • Anonymous
    August 05, 2013
    Thank you Thank you Thank you..I missed the/sites/abc and you're a savior

  • Anonymous
    July 29, 2014
    This has really been helpful. I managed to resolve the problem. I didn't have access to the http;//server/ Problem solved! Thanks