Limit number of entries allowed by user

Hi

If I opened up my app to 100 users but wanted to limit the number of entries they could make , say 50 each (so 5000 is maximum entries for the app) how can I enforce this limit?

Thanks

There would be no native Glide way to do it. You would have to write some script to scan the entries, counting user id’s (email addresses in the case of Glide) of those entries and purge anything over the 500 limit. If you added a date to the entries you could code it in a way to purge to oldest ones. This would be done after the entry was saved. If you ran it nightly there would be a limited time where a user would have more than the 500 limit.

Great idea, just need to figure out the script now, wish me luck:)

You could use an image component and set the action to use it as a Form Button. Use some sort of formula to hide the URL of the image in the sheet whenever the number of user records is >=50. When the URL is hidden, the image will not show and the user will not be able to click on it to enter a new record.

4 Likes

@Jeff_Hager does have an excellent idea there without code. You would use the countif() function to see how many. This would work nicely if all of the uploads where on the same sheet but I suspect you could even pull it off if they were on separate sheets as well by adding countif()'s together.

2 Likes

Love when someone comes up with an elegant solution. I probably will not use this. But I am just in awe of the simple solution to a complex question.

1 Like

Interesting, need to get me head round this. Thanks

1 Like

Anyway someone could mock up a demo and sheet?

I’m sure others now and in the future could benefit from this - worried that unless we could experience potential issues.

Cheers :beers:

I threw together an example to Show/Hide an image button in https://concepts.glideapp.io/ . It’s working using formulas in the sheet, but I couldn’t get it to work using the IF-THEN-ELSE column in the Data tab. I think it would work for your situation.
I tried using the new IF-THEN-ELSE column to get the column value to equal the image URL, It works, but I still get an empty image placeholder that is clickable if I return an ELSE that is blank. I’m guessing Glide is still placing some sort of value in the virtual column that isn’t truly a blank value. Instead I’m controlling this in the sheet. It’s a little slower to update, but the image button shows/hides depending on the value in a different column. Hope that helps.

2 Likes

It does indeed, thank you ever so much. I see what you mean about the placeholder but functionally it works and does the trick. I owe you a beer :beer:

1 Like