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
You have to pull the relevant attributes from the User object using the user() function, like:
fn!concat( fn!user(myUserObject,"firstName"), " ", fn!user(myUserObject,"lastName"))
You may want to encapsulate the above into its own rule so you can use it in future projects.
Thanks, Stewart. I would have asked directly, but I didn't want to pester you
Hello. I think this may be the way to go. I'm not sure how to use this to get the correct user name.
if(isnull(ri!user), "", if(isusernametaken(ri!user),user(ri!user, "firstName") & " " & user(ri!user, "lastName"),tostring(ri!user)))
No worries. “Pestered” is my middle name. (actually, don’t tell anyone...it’s really “John”)
Hi benjamins0003 as per my understanding, below mentioned code snippet will help you to deal with the following:
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:
Hope this will help!