Page 5 of 6
Create or update database from array items
Posted: Mon Jun 15, 2015 4:17 am
by Yurii Orishchuk
Hi Mark,
You need:
1 to have Array object on the server script side.
To see what actually you have in request parameter use "console.log()" and "typeOf()" functions.
2 then you can iterate this Array with following simple code:
pre
//You need to use your request array here
var requestArray = [1, 2, 3];
for(var i = 0; i < requestArray.length; i++){
Code: Select all
console.log("item[" + i + "] = " + requestArray[i])
};
/pre
Regards
Create or update database from array items
Posted: Mon Jun 15, 2015 3:57 pm
by Mark7294305
Hi Yurii
I followed your instructions above and it also failed and I am now completely lost on what to do. I have made 3 small videos on my app and hopefully you can see what I am doing wrong
video:1
http://screencast.com/t/XNRLcPr0UEY
video:2
http://screencast.com/t/XGxxZCWT
video:3
http://screencast.com/t/WsjthIYq
Create or update database from array items
Posted: Thu Jun 18, 2015 4:34 am
by Yurii Orishchuk
Hi Mark,
Thanks for this videos.
As i can see you don't pass all needed items in singe request(to server code).
You need to collect all items in single js array, convert to JSON put them altogether to single request parameter.
Comment all code(use /* here is a comment */)(to do nothing) in your server code and just put this request parameter(1st step) to console.
Test app - and see in server code "Trace" tab. You need to see there all your items in JSON format when you click on "Add" button.
It's first requirement.
When you do it - please show us screen shot from trace tab where we can see all these items.
Thanks.
Create or update database from array items
Posted: Sun Jun 28, 2015 4:26 pm
by Mark7294305
Hi Yurii
Ok please see the following short videos
video 1 http://screencast.com/t/ndLnzrf6z
video 2 http://screencast.com/t/jGR3rz59c
I have completed as instructed so I now need your help to
In server code - iterate through all received items
Inside each iteration need to perform:
3.1. make query to DB collection to get all items with query criteria data from current item(3rd step).
3.2. if you received 0 items in response of query you need to create object.
3.3. if you received 1 item or more in response of query - you need to update object.
Thanks
Create or update database from array items
Posted: Mon Jul 06, 2015 8:23 pm
by Mark7294305
Hello Support
Can anyone else on the support team help me with this? I have been waiting 8 days for a reply
Create or update database from array items
Posted: Wed Jul 08, 2015 5:41 am
by Mark7294305
Hello Support
Can anyone else on the support team help me with this? I have been waiting 10 days for a reply
Create or update database from array items
Posted: Wed Jul 08, 2015 7:07 am
by Alena Prykhodko
Hello Mark,
Sorry for delay.
We'll reply as soon as have news here.
Working on it.
Create or update database from array items
Posted: Sun Jul 12, 2015 6:10 am
by Mark7294305
Hello Support
Can anyone else on the support team help me with this? I have been waiting 15 days for a reply
Create or update database from array items
Posted: Sun Jul 12, 2015 6:15 am
by Evgene Karachevtsev
Hello Mark,
We are sorry for the radio silence here. We passed your request to our development team and are waiting for the reply from them.
Create or update database from array items
Posted: Thu Jul 23, 2015 1:36 pm
by Alena Prykhodko
Dear Mark,
Sorry for late reply.
Our developers looked into your question.
We have concluded that this requires additional custom logic, which falls outside the scope of standard support.
Please show us what you have tried and what does not work, so we can suggest.
Also you may consider purchasing Advisory Pack to get more in-depth help on this question. Here is more information about Advisory Pack (http://appery.io/services/#Advisory_Pack).