How to hide empty fields and frames after an InDesign Data Merge
Some tickets have a badge, a second image or a warranty line, and some do not. Data Merge leaves an empty box behind wherever a field is blank. Here is what InDesign can and cannot do about it.
Updated 24 November 2026
Short answer
InDesign's Data Merge has no built-in way to show or hide an object depending on a field. It can remove blank lines inside text, and everything else needs a script or a different tool.
What Data Merge can do: remove blank lines
In the Data Merge panel menu choose Content Placement Options and tick Remove Blank Lines for Empty Fields. If a field is empty, the line it sits on is removed from the text instead of leaving a gap. It works for lines of text inside a frame. It does not remove the frame itself, a rule line, a dot leader or an image.
Put the answer in the data
If a blank field should say something, such as "No warranty", put that text in the spreadsheet. It is the simplest fix and always works, although it does not hide anything.
Label the frames and run a script after the merge
A common approach on the Adobe forums is to give each optional frame a label with Window > Utilities > Script Label, run the merge, then run a script that finds empty labelled frames and removes or hides the group they belong to. It works, but it is an extra step after every merge and you need the script.
Empty image frames keep their space
If you stack images and some rows have fewer, the empty frames still take up space. InDesign cannot collapse them by itself, so people use scripts that detect the empty frame and delete it.
GREP styles change the look, not the layout
A GREP style can colour text depending on a word, for example green for "safe" and red for "unsafe". That changes how the text looks but does not hide the frame or the shapes around it.
Where PageFill fits
PageFill finds your frames by their labels, so empty slots are hidden for you. If a ticket has fewer images than image frames, the unused frames are removed and the pictures share the image area. With Pro, a badge such as New, Clearance or Online only shows only on the tickets whose Badge column lists it, and the save roundel hides itself when there is no saving. You design the ticket once and the empty parts disappear on their own.
Try PageFill free Compare Standard and Pro
PageFill is built for price tickets, shelf signs and sale cards. It is not a catalogue or directory tool. It runs inside Adobe InDesign 2020 or later on Mac and Windows.
Further reading: Adobe Help: Merge data in InDesign.
More InDesign tips
- InDesign Data Merge: Multiple Records per Page is greyed out (how to fix it)
- InDesign Data Merge shows broken accents and strange characters: the fix
- InDesign Data Merge says images are missing: how to fix it
- InDesign Data Merge overset text: how to make long text fit
- How to make price tickets in InDesign from Excel
- How to make your own price ticket template in InDesign
- All InDesign tips
