I'm developing a chatbot using Google App Scripts and I was wondering how to get a textInputs field required/ mandatory. For example, I have a dialog Box with an input text (as reported below) and i would like to get this field mandatory to fill in for the user. How can I do it?
Thanks a lot.
{....
"textInput": {
"label": "Name",
"type": "SINGLE_LINE",
"name": "contactName"
}
....}
This is the entire Dialog Box with different text input fields and I would like get them required to fill in for the user.
return {
"action_response": {
"type": "DIALOG",
"dialog_action": {
"dialog": {
"body": {
"sections": [
{
"header": "Add new contact",
"widgets": [
{
"textInput": {
"label": "Name",
"type": "SINGLE_LINE",
"name": "contactName"
}
},
{
"textInput": {
"label": "Address",
"type": "MULTIPLE_LINE",
"name": "address"
}
},
{
"decoratedText": {
"text": "Add to favorites",
"switchControl": {
"controlType": "SWITCH",
"name": "saveFavorite"
}
}
},
{
"decoratedText": {
"text": "Merge with existing contacts",
"switchControl": {
"controlType": "SWITCH",
"name": "mergeContact",
"selected": true
}
}
},
{
"buttonList": {
"buttons": [
{
"text": "Next",
"onClick": {
"action": {
"function": "openSequentialDialog"
}
}
}
]
}
}
]
}
]
}
}
}
}
};
}