John5269257
Posts: 0
Joined: Mon Jun 17, 2013 11:04 am

posting a complex object

A quick check about mapping post requests in the appery gui please:

I have to post a complex json object something like this (some fields removed for clarity):

{
"CommunicationId": 3379,
"Subject": "test",
"Title": "IC 26-06-2013 09:14",
"TaskResponse": [
{
"TaskId": 387,
"Complete": false,
"TaskResponseId": 258,
"Subject": "foobar",
"CompletedById": 2,
"AuditUserId": 2,
"Status": 1,
"TimeTaken": null
}
]
}

It isn't my service, so I can't simplify it.

Here's a shot of my mapping so far:

Image

The UI doesn't let me map the responseGrid on the page to TaskResponse in the service parameters.

This may be because:
a) Appery doesn't support mapping complex objects to post requests,
or
b) I'm doing something dumb.

If it's a) I'll try using javascript and jqXHR, but I'd like to do it the Appery way if possible. Can you guide me?

Thank you
John

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

posting a complex object

Hello! Add JS for TaskResponse and in this JS form and return needed array (not string, but array). For example:

codevar arr = [];
var obj = {};
obj["TaskId"] = Appery("TaskId").val();
.....
arr.push(obj);
return arr;/code

Return to “Issues”