I am trying to make messages that get deleted after a timed event

I am building a “party app” where users that join a party can talk to other users that have also joined that party. Once the party ends, all of the messages for that party get deleted.

I have a party content type with your usual things like title, description and all of that.

Users have their usual info but i have a rudimentary tag system (list of texts). When the user joins the party they get a tag of “party name” (so they can be part of multiple parties if needed). My approach was to also tag the users messages with this same “party name” and perform an action on the date/time the party ends saying something to the effect of:

  1. Once the party ends, take the "party name tag off the user.

  2. Delete all messages with the “party name” tag.

I just want to make sure that this is the correct way to go about this or if there isn’t a more efficient way to accomplish this.

I can’t say whether or not your way is the “correct” way (there is almost always more than one way to accomplish just about everything in Bubble) or the most efficient way, but I do something similar to what you have described, and it appears to work well for me.

I assume party names have to be unique? If that’s not the case, you could definitely run into some trouble there… but I’m guessing you’ve thought of that already.

Best…
Mike

No, party names would be unique (I will probably go so far as to check to see if there is a duplicate and make a worfklow to change to a different name). Just wanted to make sure that this was at least a proper direction to go before I start adding things and working with it.

Thank you

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.