3

I'm using InDesign to data merge a mail list with a letter. Some entries are single addresses, others are married addresses; in the salutation the customer wants to greet the reader by first name(s).

How can I place "and" such that it does not appear for single people? For instance, the salutation should say "Dear John and Mary" or simply "Dear John", where the conjunction is in my InDesign master, not in a field in the merge source.

1
  • If you are on Mac and a regular datamerge user - i recommend using MyDataMerge (mydatamerge.com) - it saves us tons of time by solving issues like that with ease. Keeps your layout clean and does exactly what you need with simple drag and drop and click (check this video where they show conditions youtu.be/r2hgHIB1fjQ)
    – Pat_Morita
    Commented Mar 21, 2019 at 23:14

2 Answers 2

2

You would just use conditional text.

Choose Window > Type & Tables > Conditional Text to display the Conditional Text panel.

Then choose New Condition from the Conditional Text panel menu, and type a name for the condition.

Select the text to which you want to apply the condition. In the Conditional Text panel (Windows > Type & Tables > Conditional Text), do any of the following:

  • To apply a condition, click the condition, or click the box next to the condition name.
  • To apply a condition and remove other conditions applied to the text, Alt-click (Windows) or Option-click (Mac OS) a condition.
  • To remove a condition, click the box next to the condition name to remove the check mark. Or, click [Unconditional] to remove all conditions from the selected text.

And there you have it!

enter image description here

1
  • 2
    This solution isn't tied to the data merge file, though, right? The OP would have to manually check/uncheck each condition for each merged document. Is there a way to link the condition directly to the merged data (so that if "Spouse" is blank, the condition is unchecked)?
    – dpruth
    Commented Nov 26, 2019 at 17:36
2

The easiest solution is to create another column in your CSV/Excel to include the word "and" if the Spouse field has data.

In your Excel file:

Row |  Column A | Column B | Column C
  1 | FirstName |  Spouse  | Conjunction
  2 |   John    |   Mary   | =IF(ISBLANK(B2),"", " and ")

You may also need to highlight all of column C, copy it and select "Paste Values" before saving as a CSV or TXT file.

Drag the formula in Column C all the way down your list of names.

In your InDesign document where you want the salutation, use all three merge fields:

Dear <<FirstName>><<Conjunction>><<Spouse>>,

Note that there are not spaces between these merge fields in InDesign. The spaces were added around the word "and" in the Excel formula, so that InDesign doesn't insert additional spaces if there is no spouse.

1
  • It would be nice if this functionality was built into indesign. Anything to move steps away from preprocessing CSV files
    – Veggiet
    Commented Aug 19, 2022 at 15:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.