Expand my Community achievements bar.

SOLVED

LiveCycle: adding a comma after a greeting in a form letter

Avatar

Level 2

I'm new to form design, LiveCycle, javascript, etc.  I'm working on a fillable form letter and I need something which seems pretty simple but I can't find a solution anywhere.

I want the name from the first fillable field of the address block to automatically fill into the letter greeting.   This is simple, and I've found various ways to accomplish this:  what I can't figure out is how to have a comma autofill after the name.  Does this make sense?  I would rather not have a "hard coded" comma hanging out to the right of the name, or have the name justify right so that there's a gap between "Dear" and the name.

I just want the greeting to say "Dear [name autofilled from address block] , "   ...I just can't figure out how to get that comma to autofill after the name.

Help, please!!

1 Accepted Solution

Avatar

Correct answer by
Level 4

Try this:

  1. Create a text field.
  2. In the calculate event, using FormCalc, insert the following formula in the scripts window:

Concat("Dear", " ",object_name,",")

Note that each item in the list of concatenated items is separated by a comma and the list must be enclosed with parentheses. When inserting straight text (instead of a field), the text must have " " on either side of the text. To insert a space use: ," ",. The object_name would be the name you gave to the object that contains the addressee's full name. Thus, we have Dear, a space, the name, and a comma immediately after the name with no space.

Good luck.

View solution in original post

4 Replies

Avatar

Correct answer by
Level 4

Try this:

  1. Create a text field.
  2. In the calculate event, using FormCalc, insert the following formula in the scripts window:

Concat("Dear", " ",object_name,",")

Note that each item in the list of concatenated items is separated by a comma and the list must be enclosed with parentheses. When inserting straight text (instead of a field), the text must have " " on either side of the text. To insert a space use: ," ",. The object_name would be the name you gave to the object that contains the addressee's full name. Thus, we have Dear, a space, the name, and a comma immediately after the name with no space.

Good luck.

Avatar

Level 2

Hello, and thanks for your response.   This is ALMOST doing it - but it's adding the comma after the client name in the address block as well as the greeting. 

How can I keep the comma from showing up in the "object_name" field, as well?

Thank you so much - this is a tremendous help, I just need to clear up that one detail.

Avatar

Level 2

Ooops, never mind!  I still had Global data binding on those two fields.  I took that off and it works fine.

THANK YOU SO MUCH!!!   This has been driving me crazy, and this solution is so simple and works perfectly.  I appreciate your help!!