How to fetch values from other spreadsheets in the same XSLX using Phpspreadsheet?

Asked

Viewed 31 times

-1

I’m making an import of products where I first Gero a model. The template file comes with four spreadsheets:

  1. Worksheet -> Standard Sheet for Product Data Fill
  2. Environment -> List of environments registered in the database.
  3. Categories -> List of categories registered in the database.
  4. Colors -> List of colors registered in the database.

In worksheet 1 it is possible to select the data of the other worksheets in a combobox: inserir a descrição da imagem aqui

This print combobox comes from worksheet 2:

inserir a descrição da imagem aqui

What I need:

Using Phpspreadsheet (preferably), I need to read the worksheet (it’s already done), and search for the selected environment ID in the worksheet, the category id in the category worksheet, and the color id in the color worksheet.

Is there any way to get that information?

1 answer

0

I decided to run a loop on each secondary spreadsheet throwing the data in array. When adding to the bank, I look in the array for the ids I need and it worked. Maybe it’s not the best way (I’m almost sure of that rs.), but it worked.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.