【发布时间】:2018-07-05 07:48:31
【问题描述】:
视频解说:http://somup.com/cFVT06Vw8l
我正在运行一个代码步骤,该步骤使用正则表达式在 webhook 包中查找字符串,然后为下一步设置我的输出变量,即 zapier 电子邮件。 问题是,我测试的 3-4 次中只有 1 次有效。历史表明 javascript 工作不正确......它没有错误,全是绿色的,但它不可靠。我错过了什么?
var patt1 = new RegExp("test");
var patt2 = new RegExp("teamPlus+");
var patt3 = new RegExp("tier1");
var patt4 = new RegExp("Luli Cleaning");
if(patt1.test(inputData.client)){
output = {name: 'Pravesh', email: 'y123@gmail.com'};
}
else if(patt2.test(inputData.client))
{
output = {name: 'teamPlus', email: 't123!@gmail.com'};
}
else if(patt3.test(inputData.client))
{
output = {name: 'Tier1', email: 'l231@gmail.com'};
}
else if(patt4.test(inputData.client))
{
output = {name: 'Luli Cleaning', email: 'lu123@gmail.com'};
}
【问题讨论】:
标签: javascript zapier