Page 2 of 3

displaying completed tasks by user

Posted: Tue Mar 04, 2014 3:41 am
by Shawn Johnson

I can manually enter via the database, in which case i can get return values from the where clause. I can also create using by testing the create service for the new collection with the pointers(user_id & task_id) here are the screen shots

I created an entry in the collection with pointers using the database create service
Image

I can use the entries but no values for user_id and task_id

Image

when I run the query I get an error

Image

i was trying to create entries in the collection from the form by use local storage items, and I get the same results

Image


displaying completed tasks by user

Posted: Tue Mar 04, 2014 5:33 am
by Illya Stepanov

As we can see on this screenshot: https://d2r1vs3d9006ap.cloudfront.net...
you are changed column name (not as was proposed).

In this case you should use your own column names.

Please change requests accordingly to your DB structure.

If you have not luck on this, please share your DB with us.


displaying completed tasks by user

Posted: Tue Mar 04, 2014 5:41 am
by Shawn Johnson

I saw this error and I fixed but it didn't fix my issue I have shared access to my database with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a


displaying completed tasks by user

Posted: Tue Mar 04, 2014 1:39 pm
by Nikita

Hi Shawn.

You have used a name of table user in the parameter 'where', but there is collection User_id in your DB. These names should be the same.


displaying completed tasks by user

Posted: Tue Mar 04, 2014 3:25 pm
by Shawn Johnson

hello,

I made the change you suggested. I am still unable to create entries in the table.
can you please try to create entries in the user_chall collection using the create service. I have been trying many different ways and still nothing


displaying completed tasks by user

Posted: Tue Mar 04, 2014 11:34 pm
by Alena Prykhodko

Hi Shawn.

To update pointer field you should pass the object with "collName" and "_id"

To create "user_chall" colllection item please use:

  1. for "user_id" collumn:
    pre{"collName": "users", "id": "5312f844e4b013c661e401fe"}/pre

  2. for "chall_id" collumn:
    pre{"collName": "challdata", "_id": "5313f769e4b07b0d80141dcc"}/pre

    More information how to work with pointer-type columns you can find here: http://docs.appery.io/documentation/b...


displaying completed tasks by user

Posted: Wed Mar 05, 2014 2:12 am
by Shawn Johnson

The example above dose not populate the challdata id.
Image
See here is the service test
Image


displaying completed tasks by user

Posted: Wed Mar 05, 2014 3:38 am
by Alena Prykhodko

Dear Shawn.

In post above parameters are:

  1. for "user_id" collumn:

  2. for "chall_id" collumn:

    But in your screenshot you have:
    "user_id" - which is ok.
    "user_challenges" - that's a reason of you problem. As in your "user_chall" collection - there is no "user_challenges" collumn.

    Please sort out your database first.


displaying completed tasks by user

Posted: Wed Mar 05, 2014 3:57 am
by Shawn Johnson

Thank you

I see the issue was not with my database but with the service I created, while debugging the issues i changed the column name, but never updated the create service request fields.

I have to be more careful about that. Thanks again.


displaying completed tasks by user

Posted: Thu Mar 06, 2014 8:55 am
by Shawn Johnson

whats the best way to pass local storage variables in the json object

return ('{"collName": "users", "id":"'+localStorage.getItem('Users_ID')+'"}');

is not working I am not getting the user id in json object.

-Shawn.J