Displaying Full Name

Hello. I have made a form and can have it send via email to recipients. When I enter the account manager, in the email the name is listed as "john.smith." How can I have the name listed properly ("John Smith")? Thanks

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    Hi  as per my understanding, below mentioned code snippet will help you to deal with the following:

    • Handling Null values
    • Check whether user exists in the environment or not
    • If all parameter met, retrieve the user full name (First_Name Last_Name)

    if(
      and(
        isusernametaken(ri!user),
        not(
          isnull(ri!user)
        )
      ),
      /* Evaluate this only if the username exist in Appian and input is not null */
      concat(
        user(ri!user, "firstName"),
        " ",
        user(ri!user, "lastName")
      ),
      {}
    )

    Note: Here ri!user is a rule input of type Text.

    How to use this rule & populate the proper name (formatted) into an email.

    I believe, you have defined an email Template / Hard coded email body with few dynamic contents including username in your process model. Here, Instead of passing pv!username, you need to replace it with rule!formatUserName(user: pv!username). In this approach your formatted name will be listed in your email instead of the default format.

    NOTE: 

    • Here pv!username is a process variable of type User / Text and holds the username (can be dynamic) needs to be included in your email dynamically
    • formatUserName is an expression rule we have created with above code snippet

    Hope this will help!

Reply
  • 0
    Certified Lead Developer

    Hi  as per my understanding, below mentioned code snippet will help you to deal with the following:

    • Handling Null values
    • Check whether user exists in the environment or not
    • If all parameter met, retrieve the user full name (First_Name Last_Name)

    if(
      and(
        isusernametaken(ri!user),
        not(
          isnull(ri!user)
        )
      ),
      /* Evaluate this only if the username exist in Appian and input is not null */
      concat(
        user(ri!user, "firstName"),
        " ",
        user(ri!user, "lastName")
      ),
      {}
    )

    Note: Here ri!user is a rule input of type Text.

    How to use this rule & populate the proper name (formatted) into an email.

    I believe, you have defined an email Template / Hard coded email body with few dynamic contents including username in your process model. Here, Instead of passing pv!username, you need to replace it with rule!formatUserName(user: pv!username). In this approach your formatted name will be listed in your email instead of the default format.

    NOTE: 

    • Here pv!username is a process variable of type User / Text and holds the username (can be dynamic) needs to be included in your email dynamically
    • formatUserName is an expression rule we have created with above code snippet

    Hope this will help!

Children
No Data