traba5058 Posted February 12, 2018 Share 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 Link to comment Share on other sites More sharing options...
traba5058 Posted February 12, 2018 Author Share Posted February 12, 2018 All, I found the error. Thanks everyone! Traba Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted February 12, 2018 Share Posted February 12, 2018 You could do it more succinctly: return [Rule("RuleEmailFirstName"), Rule("RuleEmailLastName")].filter(String).join(".") + "@" + Field("Email Domain"); Quote Link to comment Share on other sites More sharing options...
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.