Daan
Posts: 0
Joined: Thu Mar 05, 2015 1:24 pm

store list output with remarks in different collection

Hello, i have a list of questions that i display in a list, i want to store the answers on the questions and the remarks on those same questions to a collection.
i have no experience working with REST services and so i can't manage to get the input to the collection (verry frustrating). i am getting to know JS but thats still in the basics..

Easiest to describe it ; it needs to loop through all list items and store them 1 by 1.

I have made a database and multiple collections (one for maintaining questions, one for storing answers).

I have a button that activates an "create" event "btn_save_new" ;

here is the event mapping ;
Image

any help will be much appreciated !

Egor Kotov6832188
Posts: 0
Joined: Wed Nov 19, 2014 5:15 pm

store list output with remarks in different collection

Hello Daan.

1) add invisible label to the mobilegrid_5, name it question_id_label.
2) map question's id to this label
3) in before send event for answer you need to store question id
4) on yes or no click event save id to LSV
5) map lsv to question pointer, which should be added in the collection of answers, and in the service
Here you can find how to create and query a pointer from your app
http://devcenter.appery.io/documentat...

Daan
Posts: 0
Joined: Thu Mar 05, 2015 1:24 pm

store list output with remarks in different collection

Hi Egor,

thanks for your reply, but maybe i wasn't clear or i am understanding it the wrong way.

I want to save all answers with the push of 1 button.

Egor Kotov6832188
Posts: 0
Joined: Wed Nov 19, 2014 5:15 pm

store list output with remarks in different collection

Hello Daan,
if each answer represented in DB as separate collection's item, then you need to save it one by one.

Daan
Posts: 0
Joined: Thu Mar 05, 2015 1:24 pm

store list output with remarks in different collection

Hi Egor,

Do i understand it correctly than it means that i have to create an "for each" item in the list kind of script that runs when i press "save" ? or is there a better solution ?

Egor Kotov6832188
Posts: 0
Joined: Wed Nov 19, 2014 5:15 pm

store list output with remarks in different collection

Hi Daan,

Yes, you need to aggregate your answers first and then through loop call create service, thus save it to DB as new entities, cause current MongoDB implementation doesn't support bulk creation or deletion

Return to “Issues”