Tattoued Posted April 10, 2012 Share Posted April 10, 2012 This is probably a REALLY easy formula, but I'm on overload right now, and code is way over my head for the most part, AND I don't very often have the need to create many rules... your help would be SO much appreciated! I have a field called First Name. Some of the names have only an initial. The statement where the variable data will be placed is: ">>First Name<<, you don't need to travel to Pinehurst to play an authentic Donald Ross Golf Course!" I'd like to create a rule where if the name is an initial only, remove the comma and space and make the lower case y an upper case Y and just forego the name altogether. I'm trying, but I just can't seem to make it work and I HAVE to get this job out today! HELP PLEASE! Link to comment Share on other sites More sharing options...
step Posted April 10, 2012 Share Posted April 10, 2012 return (Field("First Name").length >1) ? Field("First Name") + ", you don't need to travel to Pinehurst to play an authentic Donald Ross Golf Course!" : "You don't need to travel to Pinehurst to play an authentic Donald Ross Golf Course!"; Link to comment Share on other sites More sharing options...
Tattoued Posted April 10, 2012 Author Share Posted April 10, 2012 That's it? *sigh* I don't know why I can't "get" code... Thank you. Um... how would I put in a carriage return to split the sentence at the end of "Pinehurst"? Or maybe I should call it a line break. Link to comment Share on other sites More sharing options...
step Posted April 10, 2012 Share Posted April 10, 2012 You could do that one of two ways. You could code it into the existing rule using a break tag ("<br>"). You just need to make sure you have the check box checked to "Treat returned strings as tagged text" in the Rule Editor. return (Field("First Name").length >1) ? Field("First Name") + ", you don't need to travel to Pinehurst[color="Red"]<br>[/color] to play an authentic Donald Ross Golf Course!" : "You don't need to travel to Pinehurst[color="Red"]<br>[/color] to play an authentic Donald Ross Golf Course!"; Or you could edit the code to just only return the first name and the "y" and handle the rest of the sentence and the line spacing in the text editor window. return (Field("First Name").length >1) ? Field("First Name") + ", y" : "Y"; Then your text editor would like this: Rule("FirstNameRule")ou don't need to travel to Pinehurst to play an authentic Donald Ross Golf Course! Link to comment Share on other sites More sharing options...
Tattoued Posted April 10, 2012 Author Share Posted April 10, 2012 Excellent! That worked beautifully! Thank you so much! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.