Blog
Email - How to save multiple email addresses in a field, and configure the selection and display of addresses through a combo box
There are cases where we want to build a data entry screen where users can store multiple email addresses in a field. This post describes how to store a semi-colon separated list of email addresses in a SharePoint list, and configure a combo box control to allow the entry and display of the email addresses.
My previous post here introduces the connector, and describes how to set a single email address using this technique. The focus of this post is to build a form that can accept and display multiple email addresses.
The data structure for our sample app
Setting the items of a Combo box to display Office 365 email addresses
To configure the combo box so that it shows matching email addresses as the user types into the control, we set the items property of the combo box to the following formula.
Office365Users.SearchUserV2({searchTerm:cboUsers.SearchText}).value
We retain the default SelectMultiple property value of true. This configures the combo box to allow the entry of multiple email address.
Configuring the form to save a semi-colon separated list of email address
To update the form so that it correctly saves the email address, we set the update property of the card to:
Concat(cboUsers.SelectedItems, Mail & ";")
Setting the value of the combo box for existing records
To update the form so that it correctly displays the email address for existing values, we set the DefaultSelectedItems property of the combo box control to:
RenameColumns(Split(ThisItem.EmailRecipients, ";"),
"Result",
"Mail"
)
Because the DefaultSelectedItems property expects a table value, we call the split function to split the semi-colon separated list of email addresses into a table. For this example, the combo box control expects a column called "Mail". Therefore, we call the RenameColumns function to rename a column name of the Split function from "Result" to "Mail".
Conclusion
- Categories:
- Email - Complete guide to validating email addresses
- Bug - Sending email messages with the Office365Outlook connector that includes SharePoint file attachments no longer works
- Email - Sending messages with SMTP connector
- Email - How to open a new Outlook mail message and pre-populate the subject and message
- Email - How to send email without the Office 365 Outlook connector (using the Mail connector)
- Email - How to send mail with the Gmail connector