none
Requester name display like i:0#.f|membership|username@domain.onmicrosoft.com

    Question

  • Hi,

    I am working on infopath form and on form load set text field as  username() to show request initiator name on form. problem is that name show like  i:0#.f|membership|username@domain.onmicrosoft.com.

    pls guide how to properly fixed that issue to show user display name properly.

    Thanks.


    iffi

    Thursday, February 2, 2017 3:49 PM

All replies

  • Hi imughal,

    In the InfoPath form, we could use substring-after() function to get “username@domain.onmicrosoft.com” from “i:0#.f|membership|username@domain.onmicrosoft.com”.

    For example:

    substring-after(<field>,"i:0#.f|membership|")

    Information about InfoPath substring-after() function:

    http://www.bizsupportonline.net/infopath2010/videos/infopath-substring-after-substring-before-functions.htm

    Best regards,

    Linda Zhang


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Friday, February 3, 2017 9:23 AM
  • Hi, It will return username, what if i want to show display name. pls guide. thx

    iffi

    Friday, February 3, 2017 11:33 AM
  • Hi imughal,

    To display the Display Name in InfoPath, you could try the following steps:

    1. Open InfoPath and click the DATA tab, then click From SOAP Web Service under From Web Service.

    2. Enter the location of the SOAP Web service definition: https://<site>/_vti_bin/userprofileservice.asmx, then click Next.

    3. Select GetUserProfileByName and click Next.

    4. Make sure ‘Automatically retrieve data when form is opened’ is checked.

    5. Add a textbox. In the “Default Value” section, click the “fx” button.

    6. Click “Insert Field or Group…”. IN the data sources drop down, select the GetUserProfileByName.

    7. Choose the “Value” field and click the “Filter data…” button.

    8. Click “Add…”, select “Select a field or group…” and select “Name”.

    9. Leave the middle drop down as is (‘is equal to’) and in the last drop down choose ‘type a text…’. Type “PreferredName”.


    For more details, you could read the blog below:

    https://samsharepoint.wordpress.com/2013/04/30/infopath-get-the-current-user-without-writing-code/

    Best regards,

    Linda Zhang


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Monday, February 6, 2017 1:56 AM
  • Hi imughal,

    How are things going?

    Can you get the Display Name in the form successfully?

    If you think the post is helpful, please mark it as answer.

    Best regards,

    Linda Zhang


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Wednesday, February 8, 2017 2:07 AM