Hello,
Are you using the Web Chat sample in Developer Tools (targeting a Widget v2 deployment)?
Are you typing your phone number in the Phone field (under Chat Data section), before clicking on Start Chat button?
If yes, the value should be available using {{Chat.Customer Phone Number}} in a Text component.
There is a second way to retrieve this parameter value (and others).
You can define/add a variable in your script (Type String), with Name = phoneNumber and with the "Input" toggle enabled (i.e. Input = Yes)
You can then display it in a Text component using {{phoneNumber}}
That's also how to retrieve email.
{{Chat.Customer Email}} is not available with Widget v2/Chat v2.
Define/add a variable in your script, using Type String, with Name = email and with the "Input" toggle enabled (i.e. Input = Yes)
You can then display it in a Text component using {{email}}
When you define a variable, and enable the "Input" toggle, it means that when the script is loaded, it will try to find corresponding attributes (participant attributes with the same name) in the conversation context, and load their value in the Script variable.
On the Widgets v2 side, the information you collect in the Chat Registration Form (default registration form or custom one) and the information you provide via userData, will be propagated to the conversation, as participant attributes.
What matters is the name you use, on Widgets side, for your parameter.
If you collect the information via the Default or a Custom Chat Registration Form, it is the name of the field which matters.
I mean that if you have defined a field like the following:
{
id: 'my_custom_parameter1',
name: 'customParameter1',
maxlength: '100',
placeholder: 'label displayed when parameter value is empty in UI',
label: 'label for this parameter in the UI',
}
The value will be stored in the conversation participant attributes as "context.customParameter1" and will be available in Script using a variable named customParameter1, with Input toggle enabled, and referencing it via {{customParameter1}}
If you send the information via userData, it is the name of the userData key/value pair which matters.
userData: {
customParameter2: 'ABCD'
}
The value will be stored in the conversation participant attributes as "context.customParameter2" and will be available in Script using a variable named customParameter2, with Input toggle enabled, and referencing it via {{customParameter2}}
See these 2 other posts I gave for more information on Community forum and on Dev Forum.
Regards,