Import each multiple sheets and use the ID to next sheet as foreign key #3224
-
I have this project where user need to import data to insert to different database table. In my excel file I have 2 sheets named below: First I need to insert data from merchant_branch and use the ID to merchant_items foreign key. Here's my code:
} ============= class MerchantBranchImport implements ToCollection, WithHeadingRow, HasReferencesToOtherSheets
how can I pass the ID of the merchant branch from sheet 1 to sheet 2. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
You would have to store it somewhere in a cache, to be able to fetch it in the other sheet. Alternative is two implement it as two different imports and give the merchant id to the 2nd import. |
Beta Was this translation helpful? Give feedback.
You would have to store it somewhere in a cache, to be able to fetch it in the other sheet.
Alternative is two implement it as two different imports and give the merchant id to the 2nd import.