I am going around in circles here, BUT they are very productive circles…
I have tried to append an aggregate function (max) to a service in a webbrowser but cannot get it to work…I may be missing a ? or & or ‘ or whatever…so my question is, is it possible to combine a service and an aggregate function?
Or ideally, is it possible to create aggregate functions in codeless?
The detail…
I have the below which brings in records from table = UserWorkouts.
The purpose is 1) to remove pagination 2) bring related data from table = Users.
But the table = UserWorkouts contains multiple records for each user and I only want to keep the best one (which can be defined as the record where (column) distance is greatest. So I have sorted the records largest to smallest on distance, BUT cannot figure out how, in Microsoft Excel terminology, to remove the duplicates.
I have been playing around with aggregate functions and I can create one that does what I need (below)…but I wont have pagination removed or have the related data.
I have tried to append the aggregate function to the service in a webbrowser but cannot get it to work…I may be missing a ? or & or ‘ or whatever…so my question is, is it possible to combine a service and an aggregate function?
The below brings back the entire table…
I recommend that you try to compose the desired query in our REST console. When you get the desired result, you can transfer query to the Codeless method.
I did think, why go into the REST console and do it?, when I have already built several functions in a web browser window using the guide below and could see it all working as expected;
But after doing it in the console and then looking at my codeless again, it was somehow obvious that the aggregate function should go in as a property. This is what I ended up with for any one else stumbling across the topic…basic in hindsight I guess
To make this absolutely perfect, I would need one more filter on a related field but I believe this is currently not possible but will potentially be released soon. Is that correct?
Yes, I would want a where clause on a related field. In ‘user’ I have a column called ‘Leaderboard’ which is populated with yes/no and I would filter on yes.
Ability to use related properties in where clause exists for a long time. Just try simple combination with two tables in a REST console. If you stuck with the problem, post here about the error, etc.
One more question, can I exclude related columns.
They are not returned by default. Vice versa, you have to point what relations you want to load.