rrdwitt Posted November 29, 2017 Share Posted November 29, 2017 Hello, can anyone please help with this? I want a field value to appear within quoted literal text. Here is the current rule. switch (Field("BackCTA").toLowerCase()) case "backCTA.txt".toLowerCase(): return Field("First Name")+ ", Can you believe it's been months already?"; This works just fine as is. Problem is, I want to add the field from the data named "months" so that the final line reads. case "backCTA.txt".toLowerCase(): return Field("First Name")+ ", Can you believe it's been MONTH FIELD months already?"; Quote Link to comment Share on other sites More sharing options...
MeeshKB Posted November 29, 2017 Share Posted November 29, 2017 Maybe I'm missing a complicating factor here, but could you not just do this... case "backCTA.txt".toLowerCase(): return Field("First Name")+ ", Can you believe it's been " + Field("MONTH") + " months already?"; Quote Link to comment Share on other sites More sharing options...
rrdwitt Posted November 29, 2017 Author Share Posted November 29, 2017 Yes, that worked perfectly. Thank you! Quote Link to comment Share on other sites More sharing options...
step Posted November 29, 2017 Share Posted November 29, 2017 case "backcta.txt": return Field("First Name") + ", Can you believe it's been " + Field("Month") + " months already?"; You could also take care of adding an "s" for plural months like this: case "backcta.txt": var months = Trim(Field("Month")) + " month"; months += /^(1|one) month$/i.test(months) ? "" : "s"; return Field("First Name")+ ", Can you believe it's been " + months + " already?"; Quote Link to comment Share on other sites More sharing options...
rrdwitt Posted November 30, 2017 Author Share Posted November 30, 2017 Awesome, I like it! Thank you! 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.