我正在尝试验证我的 Whatsapp 流程上的 TextInput 字段,但失败了。我该怎么办?

问题描述 投票:0回答:1
{
   "type": "TextInput",
   "required": true,
   "label": "National ID  Number",
   "name": "national_id",
   "input-type": "text",
   "min-chars": 14,
   "max-chars":15,
   "helper-text": "eg. 70-123456-C-78"
                                
}

在我的个人详细信息屏幕上,我从 textInput 中获取用户 ID,但是,我想验证使用此模式“^(?i)\d{2}-\d{5,7}-”获得的输入[A-Za-z]-\d{2}$"。我该怎么办?

我尝试使用模式,但收到错误“不允许使用属性模式”

whatsapp whatsapp-flows
1个回答
0
投票

流程目前不支持正则表达式进行验证。您只能通过添加端点来验证这一点,该端点会将值提交到后端服务器以验证该字段并向流程返回错误消息。您可以使用 TextInput 上的“错误消息”字段显示错误消息

添加 Flow 端点的文档 https://developers.facebook.com/docs/whatsapp/flows/guides/implementingyourflowendpoint

© www.soinside.com 2019 - 2024. All rights reserved.