(I'm documenting this a bit more explicitly to make this thread more valuable for people finding it in the future)
Your solution is a good example of doing this. What you do is:
- Import the materials (top of the diagram below)
- Loop over the Bucket lines (ConvertFromExcel)
- Look up each Material ID via an aggregate called GetMaterialsByMaterial where there is a filter that returns the line where the Excel_Buckets.Material = Material.Material
- Assign the fields, including BucketRecord.Bucket.MaterialId = GetMaterialsByMaterial.List.Current.Material.Id (This uses the fact that the aggregate only returns one line back to us, so we can assume Current row to be the right one)
- Create Bucket call
This effectively avoids storing temp columns in my database. Solved!
(Goncalo's drawing for reference)
