Add a participant

Options

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

  • Pawel Magdanski
    Pawel Magdanski Member ✭✭✭
    Answer ✓
    Options

    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