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'; 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. Link to comment Share on other sites More sharing options...
Scott Posted June 21, 2011 Author Share Posted June 21, 2011 thanks! works great Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.