Limit the number of dates added by users

Hello,
Is it possible to limit the number of dates or items each user can enter in their calendar? For example, some may enter 1 date, others 3 dates and others 5 dates?

I saw this post but I think there may be a more suitable solution since 2019?

Thanks

Yeah, this is easy enough.

You just need two columns in your User Profiles table. One to hold the maximum allowed entries, and another to hold the actual. Each time a user adds an entry, increment the actual by one. And then if the actual is equal to the maximum, don’t allow any more.

Depending on your setup, you may need to create a single relation to your User Profiles table to facilitate the increment.

Thanks Darren.

I understand the logic.
I added the +1 increment to the button for adding dates (Add an action) but this adds the number 1 in the “events” table, not in the “Users” table.
I managed to create a “Roll-up” column in my “Users” table to sum and repatriate all those 1’s but that doesn’t consider the creator of the event, so everyone ends up with the same value instead whether user-specific.

And when maximum number of events = number of events added, which formula use to block the addition of date at the user level?

Sorry for these basic questions but I’m new to the platform :wink:

Yeah, this is where you need the relation that I mentioned. I assume that you save the Event Creators email address in your Events table? Assuming yes, then create a Single Relation column that joins the creator email to the email column in your Users table. You can then do a Set Column values or an Increment through that relation to adjust the values as each user creates an Event (but… see below…)

Actually, this is probably a better approach than the increment. And you’re on the right track. What you need to do is first create a multi-relation column that joins Users->Email to Events->Email (creator), and then do a roll up count through that relation. This will give you individual counts for each user.

You can then use those counts to drive filters and/or component visibility conditions.

1 Like

Thank you very much Darren for your advice, it worked!