1. Mike Fisher
  2. PowerBuilder
  3. Friday, 9 February 2024 15:56 PM UTC

I have to build out a somewhat complex JSON file.

I'm using the JsonGenerator object to build out the root structure which includes a array of submissions. I could build out the entire file with the JsonGenerator functions, but this will be tedious and unmaintainable due to the json complexity.

I have decided to

  1. store the submission json template in a text file
  2. load the text file into a string variable
  3. pass the required data into the json string variable.
  4. I then want to load the filled out json string variable into a JsonParser object
  5. and finally load the JsonParser object into the JsonGenerator object submission array using the AddItemObject function

I'm struggling a bit with the AddItemObject function. 

Is it possible to add a json object to a json array using the AddItemObject function?

 

René Ullrich Accepted Answer Pending Moderation
  1. Monday, 12 February 2024 06:51 AM UTC
  2. PowerBuilder
  3. # 1

I'm not sure I understood what you want to do.

Why do you not insert the json string directly using the ImportString function of JSONGenerator?

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.