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

InDesign CC JS | Import Excel file into Array

Community Beginner ,
Mar 04, 2020 Mar 04, 2020

Hello,

 

I read through several threads, but couldn't become happy with the results. 

My task is:

I have several excel files, each with 2 sheets (where the first sheet contains just irrelevant information and the second one holds the data I need) and 4 colums, where the second is the product id, the fourth is a link to a directory, where the product information are.

My excel sheet looks like this:

[col1: an irrelevant number]  [col2: Product ID]  [col3: a Date]  [col4: hyperlink to a directory]

 

I need to cycle through the excel sheets, search for a specific product id and output the data of all rows into an array, where the product ID is the one that I'm looking for. Then I will display all rows in my window with the option to click on the links to open the directory, where the product info sits. There can be muliple directories/entries for the same product ID, where the hyperlink leads to a different directory, with 

 

So approach would be: 

1) Get all the excel files in the folder

2) Loop, where I get all the excel rows into an array or object, search by the product id and kick out all rows, that don't include that id number.

3) Display all remaining rows like

 

123456 on date 10.12: Open directory (Hyperlink to the directory)

123456 on date 24.12.: Open directory (Hyperlink to the directory)

 

My main struggle is getting data from the excel sheets. Google doesn't give me desirable results.

Can you guys help me how to go through the excel files?

 

Best regards

Alexander

TOPICS
Scripting
207
Translate
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
no replies

Have something to add?

Join the conversation