Hi All,
I have first Group Picker and Then User Picker.
Requirement is getting list of All group in group picker like dropdown items.
I want to load "userNames" list in User picker(based on group selected in previous group picker) and store userName in DB, how to achieve?
Thanks
Discussion posts and replies are publicly visible
You should use our group picker component followed by our user picker component. Then, use the list of selected users when writing to the database. If you need help writing to a database, please look at our documentation regarding how to create a CDT and data store entity. docs.appian.com/.../Data_Stores.html
a!localVariables( local!selectedGroup: {}, local!selectedUsers: {}, { a!pickerFieldGroups( label: "Groups", maxSelections: 1, value: local!selectedGroup, saveInto: local!selectedGroup ), a!pickerFieldUsers( label: "Users in group "&group(local!selectedGroup[1],"groupName"), showWhen: length(local!selectedGroup)>0, value: local!selectedUsers, groupFilter: togroup(local!selectedGroup[1]), saveInto: local!selectedUsers ) } )
Thanks for Answer, how to get UserName/GroupName from the Picker to store into DB, i saved but getting email id captured. How to get UserName only?
If you are viewing the email then in this case the username and email are the same. The user picker component returns an Appian user, displaying the username
in my case our business id was stored like, dshinde@abc.com, want to get as "deepak shinde"
Gotcha, so the first and last name. You can use the expression:
a!localVariables( local!users: rule!getUsers(), local!displayNames: a!forEach( local!users, user(fv!item,"firstName")&" "&user(fv!item,"lastName") ) )
Thanks for quick Also, want to trigger email to selected user&group. I think In process model, I need to add E-mail service between input and data store. And assign pv!userName in to List. correct?
Yes, you may need to use the function toemailrecipient() https://docs.appian.com/suite/help/20.3/fnc_conversion_toemailrecipient.html which will help convert a user or group to emails