1. Malek Taha
  2. PowerBuilder
  3. Wednesday, 14 December 2022 18:59 PM UTC

Hi

   I load a json file (template) to a JSONPackage object. i was able to set the values of the objects using below.

The issue i am facung now is how to update the objects of the array for the example below the "stops" array

sorry I am inexperience with jason.

Please help

Thanks

Malek

 

 
li_Return = lnv_package.SetValueString( "commodity", "FAK" )

li_Return = lnv_package.SetValueNumber( "orderNumber", 1234 )  

 

The file looks like this

{ "commodity":"FAK",
"orderNumber":1234,
"stops":[
{
"stopOrder":number,
"stopType":"string",
},
{
"stopOrder":number,
"stopType":"string",
}
],
"weightUOM":"LB",
"lineItems":[
{
"measures":[
{
"value":3200,
},
{
"value":3,
}
],
]
}
]
}

Malek Taha Accepted Answer Pending Moderation
  1. Friday, 16 December 2022 18:36 PM UTC
  2. PowerBuilder
  3. # 1

Thank You this helps appreciated.

 

I build the JSON using the JSONGenerator and it worked fine.

The issue i am having now is how to post the JSON string to restapi using the HTTPClient object?

Please help if you can

Thanks

Malek

 

Comment
  1. John Fauss
  2. Saturday, 17 December 2022 03:59 AM UTC
Would you please post this as a separate question, Malek? You'll get better visibility of the issue and others will be able to search/find/view the thread once it gets answered. Thanks!
  1. Helpful
There are no comments made yet.
Andreas Mykonios Accepted Answer Pending Moderation
  1. Thursday, 15 December 2022 08:13 AM UTC
  2. PowerBuilder
  3. # 2

Hi Malek.

Did you use the JSONPackage object to create lnv_package? Your json is generated from a datawindow - datastore?

If you are building a json from scratch (not from a datawindow - datastore) it may be simpler to use JSONGenerator object.

Andreas.

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.