Jump to content

Field within quoted text


rrdwitt

Recommended Posts

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?";

Link to comment
Share on other sites

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?";

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...