Setting up a pre-chat field to allow end users to select their language
This article uses the documentation for Salesforce MIAW (“Salesforce Messaging for In-App & Web“) to show how you can create a dropdown menu to allow end users to select their language in Enhanced Chat. The complete documentation of this feature is on the Salesforce Support website.
Adding a dropdown menu to your pre-chat form
- Go to Setup. In the Quick Find box, enter "Embedded Service Deployments" then select this option.
- Select View from the dropdown menu for your deployment.
- Click Edit Pre-Chat.
- Select Activate the pre-chat feature.
- Choose Every Conversation to show the pre-chat form with every conversation.
- Under "Visible Pre-Chat Fields", click Add Field, then select Custom.
- Select Dropdown as your field type.
- Add a Dropdown Name, Dropdown API Name, and Dropdown API Values.
- API Values should correspond to your enabled language codes. Please refer to the standard Salesforce language codes listed in this Salesforce article.
- Dropdowns can have up to 200 values.
- Format each dropdown API value to start with a letter, contain only alphanumeric characters, and use underscores instead of spaces.
- (Optional) Create a custom label for each dropdown value that displays on your pre-chat form, as it is what your customer sees. For example, for an API value 'fr', add a custom label 'French'. If you do not create a label, the end user sees the API values. (see Step 11 below)
- Click Save.
- Save your changes to the pre-chat form.
- To create a custom label for a custom field, return to the deployment settings page and click Set Custom Labels.
- Select the language for this custom label. If you support several languages, you must create a custom label for each language that you support.
- Select Pre-Chat as the chat group.
- Under "Label Group", select Dropdown Values to customize the labels for your field’s dropdown API values.
- Under "Label Type", select Standard.
- Enter a custom label for your custom field, and then click Finish.
- Return to the deployment settings page and click Publish.