kabrams
Posts: 0
Joined: Mon Nov 18, 2013 2:05 am

Using list service to build favorite products page

Hello I'm trying to build a 'favorite product' page. I have two collections. One with the products and their ids. The other is a favorites collection with user ids and product ids. I have both collections populated. Now I'm trying to get the page to show, for a particular user, the products they favorited. I have already figured out how to send the products to the favorite collection.

I created a list service for product fav collection, requested userid and sent response to local storage variable.

Next for the products collection, I created a list service and requested the local storage variable fav id and responded with mapping to product variables.

My current output continues to be every record in the products collection. Can u help? What am I doing wrong?

kabrams
Posts: 0
Joined: Mon Nov 18, 2013 2:05 am

Using list service to build favorite products page

Wow! is anyone there?

kabrams
Posts: 0
Joined: Mon Nov 18, 2013 2:05 am

Using list service to build favorite products page

7 hours and no response...still waiting...patiently

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

Using list service to build favorite products page

Hello,

Sorry for delay, we need more time to give a solution.

kabrams
Posts: 0
Joined: Mon Nov 18, 2013 2:05 am

Using list service to build favorite products page

Hello! good morning! any word?

obullei
Posts: 0
Joined: Thu Jun 05, 2014 12:17 am

Using list service to build favorite products page

Hello!
We are working on it.
I will let you know when have more information from developers team.

kabrams
Posts: 0
Joined: Mon Nov 18, 2013 2:05 am

Using list service to build favorite products page

Do you understand the problem? It doesn't seem to be such a huge problem. BTW, I met Max at a meeting in Atlanta a couple of weeks ago and he seemed so helpful. This experience is not so much.

kabrams
Posts: 0
Joined: Mon Nov 18, 2013 2:05 am

Using list service to build favorite products page

Are you guys deliberately ignoring my request?

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

Using list service to build favorite products page

Hi Kabrams,

Sorry for the delay,

You have two solutions:

pre

1 Change your favorite collection with following way:
1.1 delete userId and productId fields.
1.2 add field "user" with type pointer to user.
1.3 add field "product" with type pointer to product.
1.4 repopulate this collection.
1.5 add to your "list" service "include" field and populate it with value "user,product"
1.6 use your "favorites" list service to create UI you need.

/pre

pre

2 Two sequentional list requests:
2.1 invoke "favorites" list service.
2.2 in "success" event handler get all product ids.
2.3 invoke "product" query service and pass ids from 2.2 to where field using "$in". See details how to do it: http://devcenter.appery.io/documentation/backendservices/database/#Query_constraints
2.4 use your "product" query service to create UI you need.

/pre

Regards.

kabrams
Posts: 0
Joined: Mon Nov 18, 2013 2:05 am

Using list service to build favorite products page

Thank you. I will try this.

Return to “Issues”