RCardinale Posted August 7, 2013 Share Posted August 7, 2013 I am creating a title field that has two routines. The first is: if(Field("Manual Title")== "") return "" else return Field("Title"); The second part to this is: if(Field("Title")== "None") return "" else return Field("Title"); Each works fine individually. How do I combine them so that the 'Manual Title field' is checked first, and then if the 'Title field' is defaulted to, it is checked for the word 'None'? Quote Link to comment Share on other sites More sharing options...
step Posted August 7, 2013 Share Posted August 7, 2013 I'm not sure I understand your first if statement. If the Manual Title field is not populated, you want to return nothing but if it is populated, you want to return the Title field? If that's the case, you can use this code with the second if statement nested within the first: if(Field("Manual Title")== "") { return ""; } else { if(Field("Title")== "None") { return ""; } else { return Field("Title"); } } But if you want to return the Manual Title field if it's populated, and return the Title field if it's not, you can try this (commented to detail what it's doing): // If Manual Title is populated, use it. If not, use Title var myTitle = (Field("Manual Title") != "") ? Field("Manual Title") : Field("Title"); // If myTitle (the title field being used as defined above) does not have a value of "None", // set it equal to its value. If it does, set it equal to nothing myTitle = (myTitle != "None") ? myTitle : ""; // Return the title return myTitle; Quote Link to comment Share on other sites More sharing options...
RCardinale Posted August 7, 2013 Author Share Posted August 7, 2013 I'm so sorry. I really messed that up. if(Field("Manual Title")== "") return Field("Title") else return Field("Manual Title"); Second part: if(Field("Title")== "None") return "" else return Field("Title"); Quote Link to comment Share on other sites More sharing options...
step Posted August 7, 2013 Share Posted August 7, 2013 So replace your code with the second block of code I wrote. Quote Link to comment Share on other sites More sharing options...
RCardinale Posted August 7, 2013 Author Share Posted August 7, 2013 That worked. Thank you very much. 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.