Add a participant
Hi,
I need to set up a sort of counter where every time a user presses a button to say they want to attend an event, the 'number of participants' column in my xano table increases by one. How might I do that?
Thanks,
G
Best Answer
-
Hi,
it depends, You probably want to avoid situtation when the same user can click multiple times and add more than 1 to the counter.
In this case you need to track somewhere which user already clicked it, either by having entirely new table with participants related to the events or by having a field with list of users in the event itself, depends on your platform needs.
If you have the list you can either update the counter based on the list or het rid of the counter completely and just return calculate the number on participant in the endpoint function stack. Again depends on the needs of your solution.
Hope that helped.
Answers
-
That's a good point @Pawel Magdanski. I would need to get the participants' ids anyway, so I should approach it as you suggest.
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback