[Progress Communities] [Progress OpenEdge ABL] Forum Post: RE: JSON - Why does not this work?

Status
Not open for further replies.
M

Mike Fechner

Guest
In a ProDataset tables are properties of the outermost object. But a table is an array of rows. So you need to add a pair of [ ] DEFINE VARIABLE theFileContent AS LONGCHAR NO-UNDO . theFileContent = '~{"Customer":[~{"Id":"45f2d341-5bec-e611-811f-70106fa9e1e1","StudentInsurance":false,"WantsPackage":true,"InsuranceUnder28":false,"CadetInsurance":false,"WantsTravelInsurance":true,"InsuranceHealth":false,"IsCollectiveSuperContentInsurance":true}]}' . def var dsh as handle no-undo . create dataset dsh . dsh : READ-JSON ( 'longchar' , theFileContent ). dsh :: Customer : FIND-FIRST () . MESSAGE dsh :: Customer :: Id VIEW-AS ALERT-BOX .

Continue reading...
 
Status
Not open for further replies.
Top