ProspectComm Posted April 20, 2016 Share Posted April 20, 2016 Does anyone know how to write a script that says if the lastname in a cell is there then return the firstname and lastname else return nothing? Basically the data is not great and some cells are empty in the lastname and they want to use both cells when applicable but dont' want the firstname without the lastname. Sorry if I didn't explain it well, novice user! thanks, Rick PS I tried searching the forum but didn't seem to find the right JS? Quote Link to comment Share on other sites More sharing options...
tou Posted April 20, 2016 Share Posted April 20, 2016 this should work....create a name rule, then insert into text editor...(hopefully all firstname fields are populated) if (trim(field("yourLastNameField"))=="") return "" else return field("yourFirstNameField")+" "+field("yourLastNameField") Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted April 20, 2016 Share Posted April 20, 2016 If you want to be a bit tricky and do it without an "if" statement: return Field("LastName") && (Field("FirstName") + Field("LastName")); Quote Link to comment Share on other sites More sharing options...
ProspectComm Posted April 20, 2016 Author Share Posted April 20, 2016 Oh Thank You! Both good options! 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.