Summarizing values from one table in another

I have a users table which has a user_id and points field. I have a points_events table which logs each time a user_id receive points for an action

I need the points field in the users table to sum the total points associated with that user_id from the records in the points_events table.

How can I do this? I need it to be as automatic as possible. Thanks for any help you can offer!

Assuming your user_id field in the points_events table is a Link to Another Record type field, your points in your users table could be a Rollup field with a SUM(values) aggregation.

Thanks so much for your response! This makes intuitive sense to me, but will I be able to POST records to points_events that automatically link to user_id in the users table?

If you’re referring to adding records via the API, I think Link Records fields take an array of record IDs. So this is possible, you’ll just need to do some extra work finding the record id for matching user_id values in the users table.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.