Show number of "likes"?

Hi all! Very new to boundless here but wow i like it already.

Question: I have implemented a system where people can favourite different articles to their profile, however I would like to show how many times an article has been favourited, how do you go about calculating that in the back end? (like social media “likes”)

Thank you,
Tom

I’m thinking you could store the # of likes as a field on the article. The “Like” button would be an edit form with just the submit button. You could then maybe add an Update Record action and increment that field. I haven’t tested this, but this might be one way. You wouldn’t be able to unlike though.

The other would be to have a Likes table where each record is just a like associated with a post. This way you’d have to figure out the total likes by the total number of associated records. I don’t know how to do this currently. I have a similar problem and would like to know if it’s possible and how.

1 Like

@gnbjohn

Thanks for the reply and the suggestion! I might have figured it out while watching another tutorial. Apparently to calculate the total number of associated records in a specific row, you can use input text and start your expression with “Count(”.

Oh and remember not to close the bracket at the end of the expression, don’t know why it breaks.

Hope that helps :slight_smile: