I have a data merge setup which uses csv data in like this: text1,@image1,text2,@image2,text3,@image3
The data is output from a server which can set the number of "sub columns", so that an output also can look like this: text1,@image1,text2,@image2
In reality there are more than one image and text field, this is just as an example. Sometimes I only want to use two "sub colums" per page and leave the other columns become empty. But when I input a csv like that into indesign I get an error that there is missing data for some placeholders. I could of course let the server output a csv with empty fields but that would complicate things a lot since I sometimes need data without the empty fields. Is there a way in Indesign to quickly select and delete all data merge fields that have missing data? If it is possible via scripting that would be awesome!
If anyone is interested, I finally found a kindof hacky way to achieve this. If you got suggestions on how to improve, I am all ears. The principle is looping through all placeholders, comparing them to the contents of the csv and remove the pageItems that contains unused datamerge placeholders.