I want all the detail line items data at one json can any one plz help me on this

Iam running an work flow that having line item and detail line item like this


in this i have captured value like 2 to the lineitemsectionvalue from resultados from the above fig and iam iterating
it in the while loop like this fig given below
this fig are Iterating like opening the first line item and and doing the screen scraping for the first detail line item and store it in the data table like this

and when comes for the second line item its overwriting the first detail line item data with second detail line item and at last the JSON making only the last detail line data in the json

First detail line item Json same like the second detail line item was also come
its not concat the detail line item json for first second and third

some details on how the json data is merged we cannot derrive. Check as it is a JArray that the n+1 data are added to the JArray e.g. with invoke method and the add method from JArray