DataWindow JSON
A DataWindow JSON is an object that contains elements
representing the various aspects of a DataWindow.
This format is supported by the following methods (For all
formats supported by a particular method, see Applicable methods):
|
Object |
Method |
|---|---|
| DataWindow | ImportJson, ImportJsonByKey, ExportJson |
| JSONPackage | GetValueToDataWindow, SetValueByDataWindow |
| RESTClient | Submit |
The structure of DataWindow JSON is as follows:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
{ "identity": "70c86603-983b-4bd9-adbc-259436e43cbd", "version":1.0, "platform":"PowerBuilder", "mapping-method": 0, "dataobject":{"name":"d_example", "meta-columns": [COLUMN-META1, COLUMN-META2…], "primary-rows": [DW-STANDARD-ROW1, DW-STANDARD-ROW2…], "filter-rows": [DW-STANDARD-ROW1, DW-STANDARD-ROW2…], "delete-rows": [DW-STANDARD-ROW1, DW-STANDARD-ROW2…], "dwchilds":{"department_id": [SIMPLE-ROW1,SIMPLE-ROW2…], "category_id": [SIMPLE-ROW1,SIMPLE-ROW2…] … } } } |
|
Elements |
Description |
|---|---|
|
identity |
A string identifying the format. Should keep |
|
version |
An integer specifying the format version. Currently it |
|
platform |
A string specifying the platform where JSON string is |
|
mapping-method |
An integer specifying the method for mapping columns.
Note: ImportJson function supports only 0 and 1, and |
|
dataobject |
An object indicating it is a DataWindow. |
|
name |
A string specifying the name of the DataWindow object |
|
meta-columns (optional) |
An array specifying the information of the DataWindow For elements about the column meta information, see |
|
primary-rows (optional) |
An array specifying the data row in the DataWindow For elements about the DataWindow row, see DW-STANDARD-ROW |
|
filter-rows (optional) |
An array specifying the data row in the DataWindow For elements about the DataWindow row, see DW-STANDARD-ROW |
|
delete-rows (optional) |
An array specifying the data row in the DataWindow For elements about the DataWindow row, see DW-STANDARD-ROW |
|
dwchilds (optional) |
An object specifying the data in the DataWindowChild. |
COLUMN-META
COLUMN-META is an object that contains elements representing the
various aspects of the DataWindow column (but not the computed
column).
|
1 2 3 4 5 6 |
{ "name": "department_id", "index": 1, "datatype": "long", "nullable": 0 } |
name — (required) a string specifying the name of the
column.
index — (required) an integer specifying the sequence order of
the column. This value will be used to map with the DataWindow column
when the mapping-method value is set to 1.
datatype — (required) a string specifying the type of the
column. This value is not used by import.
nullable — (required) an integer specifying whether to allow a
null value. 0 – a null value is not allowed, 1 – a null value is
allowed.
DW-STANDARD-ROW
DW-STANDARD-ROW is an object that contains elements representing
the detailed information of the DataWindow row.
|
1 2 3 4 5 6 7 |
{ "row-status": 0, "columns":{"column1": [CURRENT-VALUE, COLUMN-STATUS, ORIGINAL-VALUE], "column2": [CURRENT-VALUE, COLUMN-STATUS, ORIGINAL-VALUE], ... } } |
row-status — (required) an integer specifying the status of the
DataWindow row. 0 – NotModified!, 1 – DataModified!, 2 – New!, 3 –
NewModified!.
columns — (required) an object specifying the DataWindow column
information including the current value, the column status, and the
original value.
-
CURRENT-VALUE: (required) The current value of the column,
in the following data type: integer, string, boolean, or
null. -
COLUMN-STATUS: (optional) An integer specifying the column
status. 0 – (default) NotModified!, 1 – DataModified!. -
ORIGINAL-VALUE: (optional) The original value of the column,
in the following data type: integer, string, boolean, or null. The
default type is null.
SIMPLE-ROW
SIMPLE-ROW is an object that contains elements representing the
simple information of the DataWindow row. The data must be in the
following data type: integer, string, boolean, or null.
|
1 |
{ "column1":1, "column2":"name", "column3":true, "column4":null... } |
Example
Here is an example of a DataWindow JSON string:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 |
{ "identity": "70c86603-983b-4bd9-adbc-259436e43cbd", "version": 1, "platform": "PowerBuilder", "mapping-method": 0, "dataobject": { "name": "d_employee", "meta-columns": [ { "name": "emp_id", "index": 0, "datatype": "long", "nullable": 1 }, { "name": "manager_id", "index": 1, "datatype": "long", "nullable": 1 }, { "name": "emp_fname", "index": 2, "datatype": "string", "nullable": 1 }, { "name": "emp_lname", "index": 3, "datatype": "string", "nullable": 1 }, { "name": "dept_id", "index": 4, "datatype": "long", "nullable": 1 }, { "name": "street", "index": 5, "datatype": "string", "nullable": 1 }, { "name": "city", "index": 6, "datatype": "string", "nullable": 1 }, { "name": "state", "index": 7, "datatype": "string", "nullable": 1 }, { "name": "zip_code", "index": 8, "datatype": "string", "nullable": 1 }, { "name": "phone", "index": 9, "datatype": "string", "nullable": 1 }, { "name": "status", "index": 10, "datatype": "string", "nullable": 0 }, { "name": "ss_number", "index": 11, "datatype": "string", "nullable": 1 }, { "name": "salary", "index": 12, "datatype": "decimal", "nullable": 1 }, { "name": "start_date", "index": 13, "datatype": "date", "nullable": 1 }, { "name": "termination_date", "index": 14, "datatype": "date", "nullable": 1 }, { "name": "birth_date", "index": 15, "datatype": "date", "nullable": 1 }, { "name": "bene_health_ins", "index": 16, "datatype": "string", "nullable": 0 }, { "name": "bene_life_ins", "index": 17, "datatype": "string", "nullable": 0 }, { "name": "bene_day_care", "index": 18, "datatype": "string", "nullable": 0 } ], "primary-rows": [ { "row-status": 1, "columns": { "emp_id": [ 102 ], "manager_id": [ 501 ], "emp_fname": [ "Fran" ], "emp_lname": [ "Whitney" ], "dept_id": [ 400, 1, 100 ], "street": [ "49 East Washington Street" ], "city": [ "Needham" ], "state": [ "MA" ], "zip_code": [ "02192 " ], "phone": [ "6175554321", 1, "6175553985" ], "status": [ "A" ], "ss_number": [ "017349033" ], "salary": [ 50000, 1, 45700 ], "start_date": [ "1994-02-26" ], "termination_date": [ null ], "birth_date": [ "1966-06-05" ], "bene_health_ins": [ "Y" ], "bene_life_ins": [ "Y" ], "bene_day_care": [ "N" ] } }, { "row-status": 0, "columns": { "emp_id": [ 129 ], "manager_id": [ 902 ], "emp_fname": [ "Philip" ], "emp_lname": [ "Chin" ], "dept_id": [ 200 ], "street": [ "59 Pond Street" ], "city": [ "Atlanta" ], "state": [ "GA" ], "zip_code": [ "30339 " ], "phone": [ "4045552341" ], "status": [ "A" ], "ss_number": [ "024608923" ], "salary": [ 38500 ], "start_date": [ "2005-08-04" ], "termination_date": [ null ], "birth_date": [ "1974-10-30" ], "bene_health_ins": [ "Y" ], "bene_life_ins": [ "Y" ], "bene_day_care": [ "N" ] } }, { "row-status": 3, "columns": { "emp_id": [ 104, 1, null ], "manager_id": [ 902, 1, null ], "emp_fname": [ "Chris", 1, null ], "emp_lname": [ "Young", 1, null ], "dept_id": [ 200, 1, null ], "street": [ "57 Carver Street", 1, null ], "city": [ "Concord", 1, null ], "state": [ "MA", 1, null ], "zip_code": [ "12345 ", 1, null ], "phone": [ "6185551234", 1, null ], "status": [ "A", 1, null ], "ss_number": [ "010123456", 1, null ], "salary": [ 63000, 1, null ], "start_date": [ "2018-05-06", 1, null ], "termination_date": [ null ], "birth_date": [ "1984-10-12", 1, null ], "bene_health_ins": [ "Y", 1, null ], "bene_life_ins": [ "Y", 1, null ], "bene_day_care": [ null ] } } ], "filter-rows": [ { "row-status": 0, "columns": { "emp_id": [ 148 ], "manager_id": [ 1293 ], "emp_fname": [ "Julie" ], "emp_lname": [ "Jordan" ], "dept_id": [ 300 ], "street": [ "144 Great Plain Avenue" ], "city": [ "Winchester" ], "state": [ "MA" ], "zip_code": [ "01890 " ], "phone": [ "6175557835" ], "status": [ "A" ], "ss_number": [ "501704733" ], "salary": [ 51432 ], "start_date": [ "2004-10-04" ], "termination_date": [ null ], "birth_date": [ "1959-12-13" ], "bene_health_ins": [ "Y" ], "bene_life_ins": [ "Y" ], "bene_day_care": [ "N" ] } } ], "delete-rows": [ { "row-status": 0, "columns": { "emp_id": [ 105 ], "manager_id": [ 501 ], "emp_fname": [ "Matthew" ], "emp_lname": [ "Cobb" ], "dept_id": [ 100 ], "street": [ "77 Pleasant Street" ], "city": [ "Waltham" ], "state": [ "MA" ], "zip_code": [ "02154 " ], "phone": [ "6175553840" ], "status": [ "A" ], "ss_number": [ "052345739" ], "salary": [ 62000 ], "start_date": [ "1994-07-02" ], "termination_date": [ null ], "birth_date": [ "1968-12-04" ], "bene_health_ins": [ "Y" ], "bene_life_ins": [ "Y" ], "bene_day_care": [ "N" ] } } ], "dwchilds": { "dept_id": [ { "dept_id": 100, "dept_name": "R & D" }, { "dept_id": 200, "dept_name": "Sales" }, { "dept_id": 300, "dept_name": "Finance" }, { "dept_id": 400, "dept_name": "Marketing" }, { "dept_id": 500, "dept_name": "Shipping" } ] } } } |