9
Views
4
Comments
Solved
DATA SYNC BETWEEN TWO TABLES
Question

Hello

I am working on a mobile application. I have two tables called Data and Favorites.

Now I am showing data from  the APIData in a list. And for each element of the list , I have to show whether it is favorite or not(using filled and empty stars).

I have made two aggregates. One for APIDATA(filtered by categories(which is an attribute)) and other for favorites(filtered by DeviceID).

In the APIDATA aggregate I am making an additional attribute where I am using the condition 

If(APIData.Id=GetFavoritesByAPIDataId.List.Current.Favorites.APIDataId,True,False)

But I am not getting result correctly. I think the problem can be that it is just checking first element of Favorites and not all favorites.

How to solve this?





Rank: #381
Solution

You can add the DeviceID as a Join condition in the aggregate. So not in the filter, but add it to the join:

APIData.Id = Favorites.APIDataId and Favorites.DeviceID = X.

Does that work for you?

Rank: #381

Hi Shubham,

You should use both entities in a single aggregate. You use APIData with or without Favorites. Whenever there's a favorite, it'll have fields. Your test can be that the aggregate field for Favorites.Id actually has data. You could use a custom field for that that checks Favorites.Id <> NullIdentifier().
You don't need to use if in that field. The condition already returns true or false.

Goodluck!

Rank: #381
Solution

You can add the DeviceID as a Join condition in the aggregate. So not in the filter, but add it to the join:

APIData.Id = Favorites.APIDataId and Favorites.DeviceID = X.

Does that work for you?