Scott Posted June 21, 2011 Share Posted June 21, 2011 I have a field in my data called "EMAIL" sometimes the data will be blank (nothing needs to print on the bizcard) sometimes the data will be john.doe sometimes the data will be john.doe@yahoo.com I need a rule that will add the "@yahoo.com" to the second scenario above, but not disrupt the others. I thought the following would work. But apparently I need a different operator (than !=). Is there someway to use a wildcard in front of @yahoo.com? if (Field("EMAIL") != "@yahoo.com") return Field("EMAIL"); else return Field("EMAIL")+'@yahoo.com'; Quote Link to comment Share on other sites More sharing options...
step Posted June 21, 2011 Share Posted June 21, 2011 return (Field("EMAIL") != "" ) ? Field("EMAIL").replace("@yahoo.com","") + "@yahoo.com" : "" ; Basically what this does is first checks to see if the field is blank. If it is, it returns a null value. If it's not, it addresses the "@yahoo.com" scenario by "replacing" the domain with nothing and then adds it back in order to avoid a "you@yahoo.com@yahoo.com" scenario. Quote Link to comment Share on other sites More sharing options...
Scott Posted June 21, 2011 Author Share Posted June 21, 2011 thanks! works great 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.