[Importer] Allow to reference importing rows
Please verify that this feature request has NOT been suggested before.
- [x] I checked and didn't find a similar feature request
Problem statement
When importing a dataset it is not possible to reference other rows from the current dataset. This is required to import a deeply nested category tree, location tree, ... (ref: https://github.com/inventree/InvenTree/issues/8166#issuecomment-2376735397)
Suggested solution
Allow to select an extra column for the primary key of the dataset lines. Then this column can be used to lookup rows when other rows reference e.g. *1 (where the * means look for a row in the current dataset with this id.).
Example:
pk,name,parent
1,Electronic Parts1,
2,Passives,*1
3,Resistors,*2
4,Capacitors,*2
5,IC,*1
6,Mechanic Parts,
This then can be used to build a graph of data and then start by importing the root node first, then the Childs of the root node, ...
Describe alternatives you've considered
Import categories or locations "level by level"
Examples of other systems
No response
Do you want to develop this?
- [ ] I want to develop this.
We already have a unique "row" number (within the dataset) - we could use this, perhaps?
What column are you referring too? You mean the index of the entry in the csv file? I would argument that this is not a great idea, as then we rely on the order of the lines in the csv table. And the order may change if people manually modify the file.
Fair point!
This issue seems stale. Please react to show this is still important.
Not stale