Help

How could I create a "Thumbs up" on a record system?

Topic Labels: Workflow Design
201 2
cancel
Showing results for 
Search instead for 
Did you mean: 
kpizzle
4 - Data Explorer
4 - Data Explorer

I have a ticketing system built out in interfaces. Id like for people to have ability to "thumbs up" an open ticket. Almost like a community voting on which feature I should add next. 

Ideally, would love to only let each user vote once per record id but I know thats alot to ask for. Is there a way I could accomplish this via a clever button or something? On an Interface page I just display a grid of open tickets, and would be great if you could just click a Button field inside of the grid to vote up on it. 

2 Replies 2

If you want to do this within a grid, maybe try:
1. Add a Checkbox field to your grid
2. Have a Number field to contain the number of likes
3. Have a Formula field which is `{Number} + 1`
4. Have an automation trigger when the checkfox field is checked and its action will be to paste the value from the Formula field in to the Number field, and clear the checkbox field

To do the one vote per person thing you could add a "User" type field and use that as a log for who's already voted with the "User who took action" data in the automation, and use conditionals to ignore a vote if that person's already voted

This does introduce an edge case where two users might try to check the same checkbox at the same time but seems rare enough that we shouldn't worry about it overmuch.  If the edge case is a concern, I think you might have to use an Interface Button element to trigger an automation directly, but that won't be doable within a grid

shivanipandey
4 - Data Explorer
4 - Data Explorer

Implementing a "thumbs up" feature for open tickets in your ticketing system can indeed be a valuable addition for prioritizing feature requests. While ensuring that each user can only vote once per record ID adds complexity, it's not impossible to achieve. Here's a suggestion on how you might implement this: Database Structure: Each ticket record should have a field to store the number of "thumbs up" votes it has received. Another table could store the relationship between users and the tickets they have voted on. This table should have at least two fields: user_id and ticket_id. Interface Design: In your interface, add a button next to each open ticket in the grid labeled "Thumbs Up" or with a thumbs-up icon. When a user clicks this button, it should trigger a script to increment the "thumbs up" count for that ticket in the database. Before allowing the vote to be counted, check if the user has already voted on that ticket. If they have, prevent them from voting again. Backend Logic: When a user clicks the "Thumbs Up" button, the system should first check if the user has already voted on that ticket. If they have, display a message indicating that they've already voted. If the user hasn't voted on the ticket yet, increment the "thumbs up" count for that ticket in the database and record the user's vote in the user-ticket relationship table. Ensure that only one vote per user per ticket is allowed. Displaying Vote Counts: Update the interface to display the current count of "thumbs up" votes for each ticket. You can refresh this count dynamically after a user votes. Security Considerations: Implement proper authentication and authorization mechanisms to ensure that only authenticated users can vote and that they can only vote once per ticket. Protect against SQL injection and other security vulnerabilities by using parameterized queries or ORM frameworks. By following these steps, you can implement a "thumbs up" feature in your ticketing system that allows users to vote on open tickets, with safeguards to prevent multiple votes from the same user on the same ticket.