Okay now its more clear to me whats going on.
On the first iteration dokumentArray is:
Code: Select all
[{"bezeichnung":"FALTANWEISUNG BOGEN \r\n","nr":"2111216","version":"03"},{"bezeichnung":"SICHERHEITSINFORMATIO \r\n","nr":"2519732","version":"03"}]
on the second iteration its:
Code: Select all
[null,null,{"bezeichnung":"FALTANWEISUNG BLATT \r\n","nr":"2099769","version":"02"},{"bezeichnung":"BEILAGEZETTEL iE10-S4 \r\n","nr":"2094921","version":"02"}]
In my code, I try to read an Order and post it to an API.
The order has multiple positions. Every Position has two document lines.
The Order looks like this:
Ordernumber: 102940912470
Pos 001 Material 123123
Dokument Nr 123123 Version 02 Bezeichnung Lalalala
Dokument Nr 345355 Version 05 Bezeichnung Blablabla
Pos 002 Material 456456
Dokument Nr 462363 Version 08 Bezeichnung Didadiada
Dokument Nr 023952 Version 10 Bezeichnung Wdwdwdd
This makes it really hard to access all of it correctly.
I need to loop through Positions and make an API Call there and then make an object on my loop for the documents and afterwards make an API Call on the id of the first record with the right document objects.