We do have a few options, as also mentioned in the other thread:
constructing the Structure with the help of e.g. Dictionaries, Arrays… and convert it to JSON afterwards
Constructing JSON by the scratch
illustrating, from where the FOR EACH would be fed or what is sent in, would be helpful. Maybe a less generic sample data will let us better understand
However also have a look at this:
For each Activity | item in CollectionOfManyJObjects | TypeArguement: JObject
Invoke Code / Invoke Method
myJObject("key3").Value(Of JArray).Add(item)
Kindly note:
We answered into the direction of For Each, as it was asked for
It is also possible to create the JArray and populate it outside and store it at the end on the JObject under the Property “key” by: