A scenario can check the phone number or email address a customer sends in chat and save it to a customer or order record. First, set up the chat action to wait for a reply and ask the customer to send only the requested value.
Check the reply
- Connect the “Any other answer” branch of the chat action to a “Condition” block.
- In the filter settings, select “Reply to a message in chat” for the block that sent the request. This filter uses replies received during the scenario and is available on branches that receive a reply.
- Under “Data type”, select the value you asked for.
| Option | What the filter checks |
|---|---|
| “Phone field” → “Telephone” | The reply contains 10 to 15 digits. Spaces, parentheses, hyphens and the plus sign are allowed and do not count toward the total. |
| “Email field” → “Valid email” | The reply contains a single email address that passes the CRM’s email validation. |
The filter checks the whole reply. For example, a reply that starts with “My number is” fails the phone check. To check for wording instead, use “Response text”. You can check whether the reply contains a phrase or exactly matches it, ignoring case.
Save the validated value
- On the branch for replies that pass the check, add “Edit customer data” or “Edit order data”.
- Select the destination field. Choose “Phone (add)” to add a customer phone number, “Phone” to update the order phone number, or the email field to save the address.
- Select “Replace with another field”. Under “Take data from”, choose the reply from the chat block that you checked. In “Field”, select “Reply text”.
On the branch for replies that fail the check, you can send another message asking for the value again. To validate and save the new reply, select the block that sent the second request in both the condition and the action that saves it.
For a date such as a birthday, see Check and save a date from a chat reply.