I have been trawling through the forum and training but haven’t found an answer so far…
I’m starting from a document with two types of records within and want to convert that to a csv format with two types of records.
For argument’s sake, let’s say it’s a sales order (with some fields like salesordernumber, total price, shipping details,…) and within the sales order multiple sales line items (fields: sku number, unit price, quantity…).
The required output is:
OR1, salesordernumber, total price, address line, postcode
OR2, salesordernumber, sku number1, unit price1, quantity1
OR2, salesordernumber, sku number2, unit price2, quantity2
A flatfile schema seems to indicate that you can have multiple record type definitions, which is what I like to think I need here.
I gave it a go and it failed. I don’t know the inner workings of the wmflatfile:converttostring but I think it might not like the fact it has to loop over the line items.
Do I need to do this in multiple steps to obtain the desired output? Any advice is welcome…