swilson Posted July 24, 2012 Share Posted July 24, 2012 Hi, I have a data file with the fields: Pre Name First Name Initial Last Name Post Name (Suffix) When I create my text box in Fusion Pro and add in the fields, I also type a comma in there. However, not everyone has a Post Name (Suffix). I would need somehow for that comma only to be used when the person has a Post Name. Please let me know how I can accomplish this. thanks, Stephanie Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted July 24, 2012 Share Posted July 24, 2012 return Field("Post Name") ? ", " + Field("Post Name") : ""; Quote Link to comment Share on other sites More sharing options...
esmith Posted July 24, 2012 Share Posted July 24, 2012 GASP! Dan must be feeling under the weather. I've never seen him post code without the code tags. Quote Link to comment Share on other sites More sharing options...
malmazan Posted December 2, 2013 Share Posted December 2, 2013 To elaborate and revive this thread, I am having the same issue but the code Dan posted isn't working for me. I've played around with it quite a bit and think I must be missing something obvious here. I have the fields: First Name Last Name Title In my variable text is set up as so: «First Name» «Last Name», «Title» Not every name has a title, so I want to remove the comma when the Title field is empty. The code I was using is: return Field("Title") ? ", " + Field("Title") : ""; Help please! Mariah Quote Link to comment Share on other sites More sharing options...
jwhittaker Posted December 2, 2013 Share Posted December 2, 2013 This is definitely not the best, easiest or most efficient but you could us something like this: //commaRule (This is the rule name) if (Field("Title") != "") return ", " + Field("Title"); else return ""; Then in your text frame you wouldn't put the comma just the rule. Field("First Name") Field("Last Name")commaRule Quote Link to comment Share on other sites More sharing options...
malmazan Posted December 2, 2013 Share Posted December 2, 2013 Thank you, Jon! That worked like a charm. 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.