Skip to main content
October 26, 2022
Question

Assign record to a page - data merge

  • October 26, 2022
  • 1 reply
  • 1358 views

Hi everyone,

I have a large document with 200 pages and a .csv file with 200 records. What I want is to assign every record to a page in numeric order. So first page has first row, second page - second row etc. Is this possible with scripting? If so, how can I start writing my script. Any tips appreciated. 

This topic has been closed for replies.

1 reply

brian_p_dts
Community Expert
Community Expert
October 26, 2022

Why would you not use the built-in DataMerge feature? https://helpx.adobe.com/indesign/using/data-merge.html

October 26, 2022

Because data merge uses one page to export all the records. And I have 200 pages and 200 records. If I use data-merge I would end up with 40000 pages in pdf

Peter Spier
Community Expert
Community Expert
October 27, 2022

I have one record per page. I have 200 records and 200 pages. I don't want to put all of the data in one frame, it defeats the purpose of my work. I just want to export 200 pages instead of 40000.


I looked at the sample file.

It looks to me as if you are trying to take the same records and rearrange them on each page of your template file so you've made multiple pages in the template. You are always going to get a final file that has one page per record times the number of pages in the template.

Since you haven't shown us any real data and a real template sample I can't say if what you want to do is possible with DataMerge, but most likely if it can be done you will need to re-design your data file so that all of the information for each field is included in your spread sheet and in the order you eant it to appear on you pages,

so instead of  columns Apples, Oranges, Bananas  with numbers in each cell you will need Line 1, Line 2, Line 3

with data row 1: Apples: 11, Oranges: 100, Bananas:7; data row two: Oranges: 0, Bananas: 2, Apples : 6; data row 3: Bananas: 3, Apples: 7, Oranges: 3

You would then set up a dingle page template that has your fields in the order Line 1, Line 2, Line 3 and the merge will give you one page per record, sorted in rolling order bcause your data is sorted in rolling order.