I want to retrieve user name on the basis of first name . How can I achieve this ?
Discussion posts and replies are publicly visible
How are you getting the list of to populate the drop down? There is a plugin that can be used to search users by properties, but if more than one user is returned with the same first name and last name, that would be an issue because you cannot ensure you are selecting the correct user.
This plugin, https://community.appian.com/b/appmarket/posts/personalization-utilities, will allow you to search users by various fields.usersearch( {"firstName"}, {0}, {"Larry"})
user search () is not a valid function in appian 21.1
How are you building your array for the dropdown? Is it being queried from a table in a database?
User will select their first and last name from drop-down based on which I have to extract user name and save it in my database. Since most of the users are not aware of username , we cannot show them in drop down. Can you please tell me a way to extract username using firstname, email or last name attributes ?
Can you use the "loggedinuser()" function so the user does not have to select their information? This function will return the userid for the user that is logged into Appian.
loggedinUser() will allow only the logged in user to be displayed. But in my case any user can be selected from dropdown
Unless First Name + Last Name is 100% unique, 100% of the time, you cannot ensure users are selecting the user they intend to select. Where are you getting the data for the array? Are all Appian users in that table?
I have created a group for users and all first and last names are unique ...is there a way or not to retrieve user name from first name ? please tell me this
Ok...the list is being generated from an Appian group? If so, make the choiceLabels a list of "First Name and Last Name" and the choiceValues the list of usernames in the Group.
a!localVariables( local!userList: getdistinctusers(cons!GLB_DEVELOPERS_GROUP),
a!dropdownField( label: "Dropdown", labelPosition: "ABOVE", placeholder: "--- Select a Value ---", choiceLabels: a!forEach( local!userList, user(fv!item, "firstName") & " " & user(fv!item, "lastName") ), choiceValues: local!userList, saveInto: {}, searchDisplay: "AUTO", validations: {} ))
thanks a lot
No problem!