-Lisa- Posted March 10, 2014 Share Posted March 10, 2014 Can anyone assist me in creating a rule which will allow me to remove spaces and/or special characters? I've got a rule which auto-populates an email address by combining the first initial of the first name (FName Field) with the last name (LName Field). This works well except in instances where a last name is something like O'Reilly or De Angela. Quote Link to comment Share on other sites More sharing options...
David Miller Posted March 10, 2014 Share Posted March 10, 2014 You can try: return Field("YourFieldName").replace(/\s|\'/g,""); This will remove spaces (s) and apostrophes (') from your field globally (g). Quote Link to comment Share on other sites More sharing options...
-Lisa- Posted March 10, 2014 Author Share Posted March 10, 2014 Thanks David! I knew it had to be a replace script...I think I just forgot the "g". Appreciate the help! Quote Link to comment Share on other sites More sharing options...
Natea11 Posted October 4, 2014 Share Posted October 4, 2014 This is exactly what I have been looking for. Well, almost. What would the complete rule on this look like? Create an email address by combining the first initial of the first name (FName Field) with the last name (LName Field) and then place "@company.com". Thanks Quote Link to comment Share on other sites More sharing options...
step Posted October 6, 2014 Share Posted October 6, 2014 Here's an example of how the entire rule could look: var first = Left(Field("FName"),1); var last = Field("LName"); return [first,last].filter(String).join("").replace(/\s|\'/g,"") + "@company.com"; 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.