• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Assign record to a page - data merge

New Here ,
Oct 26, 2022 Oct 26, 2022

Copy link to clipboard

Copied

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. 

TOPICS
Scripting

Views

689

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 26, 2022 Oct 26, 2022

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 26, 2022 Oct 26, 2022

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 26, 2022 Oct 26, 2022

Copy link to clipboard

Copied

That doesn't make sense.  I use Data merge all the time with designing Real Estate listing ads and it doesn't do that.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 26, 2022 Oct 26, 2022

Copy link to clipboard

Copied

This is a document with csv linked:

uwuuuu_0-1666820277063.png

 

This is when I export it:

uwuuuu_1-1666820310365.png

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 26, 2022 Oct 26, 2022

Copy link to clipboard

Copied

I'm sending my file. Idk if it's going to help

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Oct 26, 2022 Oct 26, 2022

Copy link to clipboard

Copied

If your main frame occupies the whole page and that you asks for single record per page, you should get what you want, i.e. not 40k pages.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 26, 2022 Oct 26, 2022

Copy link to clipboard

Copied

I ask for single record per page. But I don't have a main frame. Could you elaborate? What's a main frame? Thank you a lot

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 26, 2022 Oct 26, 2022

Copy link to clipboard

Copied

By default, Data Merge places one record per page - you need to work really hard to get more than one record per page 😉

 

Just create ONE TextFrame on your page, insert all fields in required order inside this ONE TextFrame - and generate final document. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 27, 2022 Oct 27, 2022

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 27, 2022 Oct 27, 2022

Copy link to clipboard

Copied

Yes, one TextFrame will hold one record. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 27, 2022 Oct 27, 2022

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 27, 2022 Oct 27, 2022

Copy link to clipboard

Copied

Thank you so much. I also think this is impossible with data merge. Unfortunately, I can't change it the way you propose, because not only I have 200 pages (and probably many more documents in the future) but also around 30 columns in my spread sheet. I've just taken a glance at InDesign scripting documentation and I could try using find and change function instead of data merge. Maybe I'll manage to write a script so it changes text on a certain page from a certain row. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 27, 2022 Oct 27, 2022

Copy link to clipboard

Copied

LATEST

Again, without seeing something real I can't say much.

DataMerge is a very basic, dumb, function sutable for doing things like adress labels, award certificates and directory listings. There are some commercial plugins for catalog construction that might do better for what you need.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines