Would it be possible to store voting data in a json file?

AI-generated summary

Storing Voting Data in a JSON File

natasha_selvidge inquired about the possibility of storing voting data in a JSON file to implement voting on specific contests without modifying the database. pfaffman suggested exploring the Discourse Voting feature, but natasha_selvidge found it to be too closely tied to the topic object.

pfaffman recommended checking out How to Create Polls and creating a plugin with a custom JSON field to store voting data. This approach would allow for flexibility in displaying the data. natasha_selvidge found this suggestion helpful and plans to explore custom fields further.

Would it be possible to store voting data in a json file somewhere. I am new to discourse and I want to add voting to specific contest where users can vote on as many topics, but just once in that specific contest. I am trying to avoid fussing with the db. :thinking:

Have you looked at Discourse Voting

Yes, I have I was hoping I would be able to leverage it for challenges, but I am afraid it’s very closely tied to the topic object. Whereas my system will turn on an image that’s already within a post. Technically, it should be possible to store voting data in a JSON file somewhere, no? Since discourse is essentially all JSON.

Sorry if I’m still missing your point, but have you looked at How to Create Polls.

I don’t understand just what kind of voting you’re trying to do. If you want to create a plugin then you can create a custom field with type json and stick whatever you want in it and add it to the serializer to be able to display it.

Awesome that is very helpful, and I will totally look into the custom fields :blush: Thank you.