Create or update database from array items

This forum contains topics that were moved from Get Satisfaction
Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Create or update database from array items

Post 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&#46;length; i++){

Code: Select all

console&#46;log("item[" + i + "] = " + requestArray[i]) 

};

/pre

Regards

Mark7294305
Posts: 0
Joined: Fri Dec 26, 2014 2:10 am

Create or update database from array items

Post 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

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Create or update database from array items

Post 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).

  1. You need to collect all items in single js array, convert to JSON put them altogether to single request parameter.

  2. 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.

  3. 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.

Mark7294305
Posts: 0
Joined: Fri Dec 26, 2014 2:10 am

Create or update database from array items

Post 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

Mark7294305
Posts: 0
Joined: Fri Dec 26, 2014 2:10 am

Create or update database from array items

Post by Mark7294305 »

Hello Support
Can anyone else on the support team help me with this? I have been waiting 8 days for a reply

Mark7294305
Posts: 0
Joined: Fri Dec 26, 2014 2:10 am

Create or update database from array items

Post by Mark7294305 »

Hello Support
Can anyone else on the support team help me with this? I have been waiting 10 days for a reply

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Create or update database from array items

Post by Alena Prykhodko »

Hello Mark,

Sorry for delay.
We'll reply as soon as have news here.
Working on it.

Mark7294305
Posts: 0
Joined: Fri Dec 26, 2014 2:10 am

Create or update database from array items

Post by Mark7294305 »

Hello Support
Can anyone else on the support team help me with this? I have been waiting 15 days for a reply

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Create or update database from array items

Post 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.

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Create or update database from array items

Post 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).

Post Reply