Userprofileservice.asmx With .UDCX File Gives SharePoint Admin Username Instead of First name, Last Name and suchlike - InfoPath Dev
in

InfoPath Dev

Office365 Alert - Sandbox has been deprecated in SharePoint Online.
Read more here.

Having trouble finding a blog or post that answers your question? Check out our Custom Search Page

Userprofileservice.asmx With .UDCX File Gives SharePoint Admin Username Instead of First name, Last Name and suchlike

Last post 02-17-2017 08:57 AM by K5Optima. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 12-07-2016 03:18 AM

    Userprofileservice.asmx With .UDCX File Gives SharePoint Admin Username Instead of First name, Last Name and suchlike

    I have create an InfoPath form that uses the Userprofileservice.asmx web service to retrieve the information form the AD. I have used a .UDCX file store the data connection. My environment is SharePoint 2013 with InfoPath 2013. I wanted to view the First Name, Last Name and Preferred Name on in some text boxes. So I have used the below filters

    First Name - Value[Name = "FirstName"]
    Last Name - Value[Name = "LastName"]
    Preferred Name - Value[Name = "PreferredName"]

    The XPaths are as below.

    First Name - xdXDocument:GetDOM("GetUserProfileByName 2")/dfs:myFields/dfs:dataFields/tns:GetUserProfileByNameResponse/tns:GetUserProfileByNameResult/tns:PropertyData/tns:Values/tns:ValueData/tns:Value[../../../tns:Name = "FirstName"]

    Last Name - xdXDocument:GetDOM("GetUserProfileByName 2")/dfs:myFields/dfs:dataFields/tns:GetUserProfileByNameResponse/tns:GetUserProfileByNameResult/tns:PropertyData/tns:Values/tns:ValueData/tns:Value[../../../tns:Name = "LastName"]

    Preferred Name - xdXDocument:GetDOM("GetUserProfileByName 2")/dfs:myFields/dfs:dataFields/tns:GetUserProfileByNameResponse/tns:GetUserProfileByNameResult/tns:PropertyData/tns:Values/tns:ValueData/tns:Value[../../../tns:Name = "PreferredName"]

    This SharePoint site uses Claims based authentication.

    But when I published the form to SharePoint I get

    First Name - SPPrdAdmin
    Last name - EMPTY
    Preferred Name - SPPrdAdmin

    I cannot understand what I have done wrong.
    Please could someone help on this? Thanks and regards, Chiranthaka
  • 02-17-2017 08:57 AM In reply to

    Re: Userprofileservice.asmx With .UDCX File Gives SharePoint Admin Username Instead of First name, Last Name and suchlike

    Are you populating a username first via a field labeled something like User with a default value of userName()?
Page 1 of 1 (2 items)
Copyright © 2003-2017 Qdabra Software. All rights reserved.
View our Terms of Use.