Skip to main content
Participating Frequently
November 22, 2013
Question

Multiple record data merge into paragraph styles-applies the wrong style

  • November 22, 2013
  • 1 reply
  • 45629 views

Hi, I've been working on this project for sometime and everytime I manage to get one part of the workflow to work another seems to break. My agency publishes catalogs in multiple formats: large-print, audio, braille, and HTML. I've been trying to redesing our work process so that the catalogs will be laid out from merged data out of comma-separated file. The data merges have worked fairly well in Word, but InDesign is a challenge. I'm merging multiple records on a page, like a mailing label. The paragraphs need to be formatted and I'm trying to apply a paragraph style to them. After much work, I think I've finally got the data merge to work correctly, but the wrong paragraph styles are applied. I'm going to apply a new master page to the data once the data is merge that uses the paragraph styles for text variable running headers and I need to build a table of contents based on the paragraph styles so I need this to work. Attached are some screenshots.

Master page set up for data merge with paragraph styles:

Here is the merged document with the wrong paragraph styles applied:

I have only a few weeks to get this process ironed out to keep to our rigorous production schedule. If anyone can help I would really appreciate it.

thanks,

Lina

1 reply

Peter Spier
Community Expert
Community Expert
November 22, 2013

Can't really tell from those screen shots what styles are applied to the placeholders....

LinaD36Author
Participating Frequently
November 22, 2013

Peter- All the styles on the screen have been applied.  The data has been merged onto 7 lines and each line has it's own paragraph style. But I think the problem is that some of the fields are empty and don't have data in them. The fields merged are below next to the paragraph style that they are supposed to be merged into:

<<GENRE>> (Genre)

<<SUBJECT_CODE>> (Subject Code)

<<TITLE_ARTICLE>><<TITLE>>(Title)

<<BN>> <<HRS>> hours<<MINS>> minutes (Time)

<<ROLE>> <<AFN>> <<ALN>> <<CONJ>> <<CFN>> <<CLN>> (author)

read by <<NFN>> <<NLN>> (narrator)

<<ANNOTATION>> (annotation)

The problem seems to occur because the Genre and Subject Code fields don't always have data in them and then somehow the Genre style is applied to the Title paragraph.

-Lina

Community Expert
December 5, 2013

Uwe,

I'm gong to test this tomorrow on my directory job (which I've stitched manually up to now because I'm too lazy to install the Rorohiko script). It should knock about half an hour off the time I spend.

I think I've alread got a return at the end of the last line in each record, though, in my template (I could get rid of it easily, though). Can this be edited easily to not add another?

I'm not an expert at reading javascript, but it looks to me like you are adding two returns at the start of each text frame.


@Peter – you are right. I'm adding TWO returns.

The reason is:
I assume that there is NO return at the end of each text frame and I want to add an empty separator paragraph between the texts of each text frames.

I would NOT recommend leaving a single return at the end of each text frame…

It's much cleaner to go without one and have a dedicated empty paragraph with a dedicated paragraph style for separating the contents of each text frame after running the script.

Be forwarned: depending of the number of text frames, the script takes its time.

About two minutes in the case of the material you provided (564 text frames on 141 pages in a 2x2 matrix for each page) on a five years old MacBook Pro with InDesign CS5.5 and OSX 10.6.8 installed.


Uwe