traba5058 Posted February 12, 2018 Posted February 12, 2018 I have a rule that looks at 2 fields to determine what to return. I'm getting a Javascript syntax error message on the following rule and for the life of me, I do not see it. if ((Rule("RuleEmailFirstName") != "") && Rule("RuleEmailLastName") != "")) return Rule("RuleEmailFirstName") + "." + Rule("RuleEmailLastName") + "@" + Field("Email Domain"); else if ((Rule("RuleEmailFirstName") != "") && (Rule("RuleEmailLastName") == "")) return Rule("RuleEmailFirstName") + "@" + Field("Email Domain"); else if ((Rule("RuleEmailFirstName") == "") && (Rule("RuleEmailLastName") != "")) return Rule("RuleEmailLastName") + "@" + Field("Email Domain"); else return ""; Will someone please help me and point out what I'm doing wrong? Quote
traba5058 Posted February 12, 2018 Author Posted February 12, 2018 All, I found the error. Thanks everyone! Traba Quote
Dan Korn Posted February 12, 2018 Posted February 12, 2018 You could do it more succinctly: return [Rule("RuleEmailFirstName"), Rule("RuleEmailLastName")].filter(String).join(".") + "@" + Field("Email Domain"); Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.