Thanks for checking out the Multi Email Input LWC for Salesforce Screen Flows! I built this package because I couldn't find any other component that did what I wanted. While working on a form being built in a screen flow for a client, I had a requirement to allow the end users to enter several additional emails. This fine, users can enter it in a text box and I can process it after, but what if there was an easier way??? Enter Multi Email Input! No more formulas or loops to parse user data that may or may not follow a consistent pattern. No clunky repeater element to deal with. This is a simple way to capture as many additional email addresses as your end user wants to enter!
This component works with SLDS1 and SLDS2. It looks great in SLDS2!
For now, download this repository and add the files to Salesforce with Visual Studio Code or your preferred IDE. I'm working on getting this packaged.
This component has several customizable fields.
- API Name You know this field!
- Allowed Domains Input a comma-seperated list of domains. This can be created with a text collection or as plain text. Example: gmail.com, yahoo.com, aol.com.
- Allowed Domains Error Message Enter a custom error message. This supports plain text, a text string, or rich text. If you use plain text or a text string, the message is displayed using the standard Salesforce validation error style. Rich text is fully formatted.
- Disabled Set this to true or false using a global variable or a formula.
- Help Text Add useful help text for your users. Support plain text or a flow resource. Does not support rich text.
- Label Give your field a name.
- Maximum Emails Limit how many emails your user can add. Leave blank if you don't want to limit this.
- Placeholder Text You can change this to your own placeholder text.
- Required Use a global variable or a formula to make this field required.
- Value Select a text collection of email addresses to prepolate the component.
- Output Variable The component outputs
{!apiName.emailCollection}with this formatting: '[email@one.com, email@two.com, email@three.com]`.
- Enter your list of allowed domains or enter a resource for the domains.
- When the user enters an invalid domain, they will be shown an error.
- Error messages support rich text.
Duplicate Entries are automatically prevented. This error message is not configurable.
Limit how many emails a user can enter. When they try to enter n+1, they are shown a default error message. This message cannot be configured.
Email addresses are validated using /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/. This error message cannot be configured.
After typing in a valid email address, press space, enter, or tab to add the address. Space and enter will keep the focus in the text field while tab will move to the next selection.
Click the X in the pill to remove na email address from the collection.
You can make everything to custom variables if you want to.
