Page 1 of 1

How to push to json array in DB from query service

Posted: Thu Jul 31, 2014 9:46 pm
by Deki

I have a query service that I want to execute and push data into the already existing json array. When I add the javascript below to my JS in the array field inside the update query, it overwrites the existing values with the value below. I just want to be able to add onto what is already there...as well as delete based on what the secondElement is.

pre
return ["firstElement","secondElement"];
/pre


How to push to json array in DB from query service

Posted: Thu Jul 31, 2014 10:44 pm
by Yurii Orishchuk

Hi Deki,

Unfortunatly there is no abiltity to change item field partially.

Thy only way to do it is:

1 Get current item field value(read or list/query service).

2 Modificate it with way you need(add some, delete some or alter some).

3 Update item field with full json value(update service).

Regards.