Problem with Data Merge and Ghost Hyperlinks
Here’s a story of data records that appeared more than once per page when using Data Merge… something that should not happen. This was one of the stranger problems I’ve seen with Data Merge, but I have heard of it before, so I figured I should write it up — just in case someone else has this problem in the future.
M.G. sent me a problem file which was very simple: It just contained two data fields on a simple background.
The background art was on the master page (which is good), and the data placeholders were in a text frame on the document page. That text frame was to be repeated twice per page (like a little grid: one at the top of the page and one at the bottom). Whenever you want to repeat text fields on the same page, you have to use the Multiple Records feature inside the Create Merged Document dialog box:
You can adjust the settings in the Multiple Record Layout tab to adjust the margins and column and row spacing and all that. (I’m not showing that here, because it’s not relevant for this particular problem.)
Then, when you want to test it, you can turn on the checkbox labeled Preview Multiple Record Layout.
So that’s all straightforward. But here’s what was going wrong: In this particular document, the Preview worked fine, but when we clicked OK and actually generated the merged document… it didn’t work right. The first record was duplicated, twice on the first page; the second record showed up twice on the second page… and so on.
This was very mysterious because each record should only appear once in the document.
I did everything I could think of to figure out why this was happening… including exporting the file to IDML and opening the IDML file (to get rid of any of kind of file corruption). The problem would not go away. However, if I tried to recreate the file in a new document, I had no problem.
After about 20 minutes, I suddenly remembered to look in the Hyperlinks panel, and I found something… wrong:
Most people don’t realize that Data Merge placeholders also show up in the Hyperlinks panel. I’ve never quite understood why InDesign does this (because they’re not really hyperlinks), but it just does.
But if you look at the image above, you can see that there are two hyperlinks that have a “1” next to them, which means that those placeholders appear on the first page of the document. And then there are two hyperlinks that have no page number next to them!
Those are ghost hyperlinks. They don’t really exist, they don’t really do anything, and: those are the culprits that messed up this Data Merge! As soon as I deleted them from the Hyperlinks panel, the problem went away.