1. mahmoud mahmoud
  2. PowerBuilder
  3. Monday, 20 March 2023 22:21 PM UTC

hello everybody

please i need help

//=============json text =====================

{

"errorCode":["3","5","34"],
"transactionId":"bbb119a9-3690-4016-a1e4-30a2654d05b7",
"correlationId":"3268786e-ba1f-4d61-9ad5-a3b15072a544"
}

//===========end json ================================

i need to get values of errorCode like get 3 and 5 and 34 to array variable

 

 

 

Sivaprakash BKR Accepted Answer Pending Moderation
  1. Saturday, 25 March 2023 12:56 PM UTC
  2. PowerBuilder
  3. # 1

The other option could be to use Chilkat API

https://www.chilkatsoft.com

JsonObject ActiveX Reference Documentation (chilkatsoft.com)

This page says no license is required to use JSONOBJECT.

You can try that also.  

Happiness Always
BKR Sivaprakash

 

Comment
There are no comments made yet.
Richard Donagrandi Accepted Answer Pending Moderation
  1. Thursday, 23 March 2023 15:48 PM UTC
  2. PowerBuilder
  3. # 2

We use u_json... see the attached link.

References
  1. https://github.com/informaticon/inc.win.base.pb-json/wiki
Comment
  1. Miguel Leeuwe
  2. Saturday, 25 March 2023 15:58 PM UTC
He's using PB 12.6, so that won't be a solution.

regards
  1. Helpful
There are no comments made yet.
Benjamin Gaesslein Accepted Answer Pending Moderation
  1. Tuesday, 21 March 2023 07:34 AM UTC
  2. PowerBuilder
  3. # 3

Hi Mahmoud,

in PB 12 you'll have to use string functions to separate the part between the brackets and then parse the content. The pfc has an object with string functions that should give you some pointers on how to do this, specifically the of_parsetoarray function.

https://github.com/OpenSourcePFCLibraries/12.6/blob/master/pfcapsrv/pfc_n_cst_string.sru#L82

 

 

Comment
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Tuesday, 21 March 2023 00:52 AM UTC
  2. PowerBuilder
  3. # 4

You neglected to mention which version/release/build of PB you are using.

If you are using a recent version, the JSONParser object and its methods will be useful. The following link displays an example on how you can utilize the JSONParser object. This documentation is for PB 2019 R3.

    https://docs.appeon.com/pb2019r3/application_techniques/ch04s07.html#d0e14086

Best regards, John

Comment
  1. mahmoud mahmoud
  2. Tuesday, 21 March 2023 06:54 AM UTC
thanks for reply MR John Fauss

i work with pb 12.6 version

i get external tool but array value can't get
  1. Helpful
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.