Page 1 of 1

List items can not be mapped with Array column in Update Request

Posted: Fri Jul 03, 2015 3:05 am
by Dongzhi Yang7528784

Hi Support team,

I found the issue when I tried to map a List to an Array field in an Update request.

I have a field in a collection named 'subItems' which is an Array type and its values are like '[{"name":"item1","status":"false"},{"name":"item2","status":"true"}]'.

In a query service, I can map this field to a List.
However, when I try to map it backwards from the List to the request parameters in an Update service. Somehow, it doesn't allow the link.

See the screenshot below.

Thanks

Image


List items can not be mapped with Array column in Update Request

Posted: Fri Jul 03, 2015 5:49 pm
by Serhii Kulibaba

Hello Dongzhi,

You are right it is impossible, but you can use JS on this array request parameter and read all inputs into this parameter, e.g.:

var results = [];
$("[dsrefid=mobiletextinput]").each(function(){
results.push($(this).val());
});
return results;

here "mobiletextinput" - name of the components "input"


List items can not be mapped with Array column in Update Request

Posted: Sat Jul 04, 2015 4:10 am
by Dongzhi Yang7528784

Sergiy,

smart work around! It worked!

But i still don't understand why the mapping is not possible here. It seems so obvious to me it should work.