I have 2 recordsets that I am returning via Json using 2 URLConnections. I would like to combine those 2 into one Json result. But I am not sure how to do that. Here is a sample of code that I use for one of them.
Var jsonMisc As New Dictionary
do until rs.afterlastrow
Var jsonM As New Dictionary
jsonM.Value("WoNo") = rs.Column("WoNo").integervalue
jsonM.Value("Description") = rs.Column("Description").StringValue
jsonMisc.Value(rs.Column("ID").StringValue) = jsonM
rs.MoveToNextRow
loop
rs.Close
Var jsonResults As New JSONItem
jsonResults.Value("GetMisc") = jsonMisc
Return jsonResults
Now I would like to combine that with this JSONItem so that I can use a single URLConnection to get both results at once. Is that possible? If yes, then how do I do that?
Var jsonWorkOrder As New Dictionary
do until rs.AfterLastRow
Var jsonWO As New Dictionary
jsonWO.Value("Qty") = rs.Column("ShipQty").IntegerValue
jsonWO.Value("PartNo") = rs.Column("PartNo").StringValue
jsonWO.Value("Description") = rs.column("Description").StringValue
jsonWorkOrder.Value(rs.Column("ID").StringValue) = jsonWO
rs.MoveToNextRow
loop
rs.Close
Var jsonResults As New JSONItem
jsonResults.Value("GetParts") = jsonWorkOrder
Return jsonResults