E
egarcia
Guest
Hello, There are some few ways that you could use to handle prop_pics (and room_types) as a temp-table or a dataset: - Change format of prop_pics to temp-table, use a temp-table parameter in method/procedure. - Change format of prop_pics to dataset, use a dataset parameter in method/procedure. - Keep current format and use prop_pics as a character variable and process the value as JSON using the JSON constructs in the ABL. - Keep current format and use prop_pics as a character variable and process the value as JSON by mapping the value to a temp-table. Do you have control on the format for the input? I am guessing that the answer is Yes since you are using "request" which is expected when mapping to individual parameters. The key is that the input to of the request should have the format that is expected for the parameter. In your JSON object, the props_pics parameter has the structure of an array of object, however, this does not match the expected format for an array. The expected parameter looks like the following: "prop_pics": Example (excerpt): "prop_pics": { "prop_pics": [{ "ProductCode": "MUHOT00001", "Prop_Url": "001room_1.jpg", "Prop_Title": "delux room" }, { "ProductCode": "MUHOT00001", "Prop_Url": "001room_2.jpg", "Prop_Title": "delux room" }] } Please notice that "prop_pics" is listed twice. Once as the name of the parameter and a 2nd tieme indicating the name of the table in temp-table definition. For a dataset, the format is similar and you would also need an object property with the name of the dataset. The temp-table parameter would look like the following: DEFINE TEMP-TABLE prop_pics FIELD ProductCode AS CHARACTER FIELD Prop_Url AS CHARACTER FIELD Prop_Title AS CHARACTER. I hope this helps.
Continue reading...
Continue reading...