Jump to content
Welcome to the new FusionPro User Forum! ×

Should be an easy one, but I can't figure it out... email addresses


Recommended Posts

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");


return Field("EMAIL")+'@yahoo.com';

Link to comment
Share on other sites

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

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...