Combine First Name Initial and last Name - InfoPath Dev
in

InfoPath Dev

Combine First Name Initial and last Name

Last post 09-18-2013 11:22 AM by chiga. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 09-16-2013 07:04 PM

    • chiga
    • Not Ranked
    • Joined on 09-16-2013
    • Posts 2

    Combine First Name Initial and last Name

     HI

     I am trying to get the First Name initial and Last Name from a drop down list of names in the format "last name, first name". When a user selects a name from the drop down a field should display the "First Name initial and Last Name"  Rabbit, Roger should be R. Rabbit

    I tried concat(substring(Full Name, 1, 1), " ", substring-after(Full Name, ",")) but this will give me "Last Name Initial, First Name" (the opposite of want I need).

    Thank You

  • 09-17-2013 02:20 AM In reply to

    Re: Combine First Name Initial and last Name

     It sounds like you need this:

     concat(substring(substring-after(Full Name, ","), 1, 1), ". ", substring-before(Full Name, ","))

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 09-18-2013 11:22 AM In reply to

    • chiga
    • Not Ranked
    • Joined on 09-16-2013
    • Posts 2

    Re: Combine First Name Initial and last Name

     Hi Jimmy

     thanks for the reply, Unfortunately,  that did not display the first initial.... only " . LastName"

     It is not picking up substring(FullName, 1, 1)

     

    Edit: oddly I changed it to this and it seems to have worked

    concat(substring(substring-after(Full Name, ","), 1, 2), ". ", substring-before(Full Name, ","))

    I assume with 1, 1 it was pulling a blank space?

Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.